vue高階總結三

2021-10-01 06:37:09 字數 1958 閱讀 1000

請求介面返回的字段,渲染的時候需要拼接部分字串,起初盲目for迴圈拼接,下班後回想起總感覺不對勁,果然,哈哈,vue變數字串拼接是各種支援的呢

// **渲染,行資料單獨處理  slot-scope="scope"

"站點logo" width=

"180"

>

"scope"

>

"`$.png`" width=

"80"

>

<

/template>

<

/el-table-column>

彈框表單 當前頁面進行新增、刪除需要重新整理,要不資料渲染不會變化,方法reload,其實和mounted執行的內容一樣的(不太友好)

"subname"

:visible.sync=

"dialogformvisible"

>

"ruleform" status-icon :rules=

"rules" ref=

"ruleform" label-width=

"100px"

class

="demo-ruleform"

>

"使用者名稱" prop=

"username"

:rules="[

,]">

"ruleform.username"

>

<

/el-input>

<

/el-form-item>

"密碼" prop=

"password"

:rules="[

,]">

"ruleform.password"

>

<

/el-input>

<

/el-form-item>

"手機號" prop=

"phone"

>

"ruleform.phone"

>

<

/el-input>

<

/el-form-item>

"isub" type=

"primary" @click=

"submitform('ruleform')"

>確 定<

/el-button>

else type=

"primary"

:loading=

"true"

>請求處理中...

<

/el-button>

"resetform('ruleform')"

>取 消<

/el-button>

<

/el-form-item>

<

/el-form>

"errmsg != ''"

>

"errmsg" type=

"error" effect=

"dark"

>

<

/el-alert>

<

/div>

<

/el-dialog>

submitform

(formname)

that.$ajax.

post

('/test/test/test'

, basedata)

.then

(function

(response));

that.

reload()

}else

if(response.data.code ==2)

).catch

(function

(error))}

else});},

reload()

vue高階總結二

上篇僅僅談論到介面資料渲染,這篇主要是使用過程中的demo 解決方法 1 路由配置檔案router index.js 跳轉路由前判斷是否登入2 關於涉及許可權頁面元件載入函式判斷 router.beforeeach to,from next else else export default rout...

spring總結 三 高階裝配

一 spring profile 1.1 目的 1.2 方式spring profile配置 bean profile production public datasource jndidatasource dspring.profiles.active production spring.prof...

vue高階用法

1.mixin 1.全域性混合 2.全域性api 1.vue.extend 擴充套件例項構造器 2.vue.nexttick dom結構改變後執行 3.vue.directive 指令 4.vue.filter 過濾器 5.vue.component 註冊元件 3.watch 深度watch 4.v...