Application of filters
- Interpolation expressions in the application
{{scope.row.createTime | formatDateTime}}
filters: {
formatDateTime(time) {
if (time == null || time === ' ') {
return 'N/A';
}
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')}},Copy the code
Cannot use await in $confirm then()
Asynchronous requests in $confirm then
In $confirm, some operations need to be performed after clicking OK. At the beginning, I wrote it directly in front of methods. Can not use keyword ‘await’ outside an async function Can not use keyword ‘await’ outside an async function Put async inside then()
El-select Is used with value-key=”id” and the command output is displayed
Project back end to the current option id and name, so passing through the following way, refer to the address: www.cnblogs.com/yxkNotes/p/…
<el-form-item label="Feedback content">
<el-select v-model="fankui_contentobj" class="shutiao" value-key="id" @change="selectSubjectItem($event)">
<el-option v-for="item in fkcontentType" :key="item.id" :label="item.name" :value="item" />
</el-select>
</el-form-item>
data() {
return {
fankui_contentobj: { id: ' ' }, // select value-key="id}}methods: {init(){/ / echo
for (const key in this.form) {
this.form[key] = this.info[key]
}
// Handle the content and type of feedback
this.fankui_contentobj.id = this.info.fankui_content
},
selectSubjectItem(event) {
console.log('event', event)
this.form.fankui_content = event.id
this.form.fankui_content_text = event.name
},
}
Copy the code
JSON
Parse (STR) var obj = json.parse (STR)
Var STR = json.stringify (obj)
Parse (json.stringify (obj))
The use of vuex
The interface is repeatedly fetched for each page of people, so the requested data is placed in vuEX
Method 1:
Method 2:
Mobile debugging tool – Eruda.js
The communication mode of Vue sibling components can be eventBus
www.cnblogs.com/wjw1014/p/1…
Life cycle order of vUE parent components, index list
Created: created Mounted index created list created list mounted index created
Update: Update index beforeUpdate List beforeUpdate List updated index updated
Destroyed: Destroyed Index befordeStory list beforedeStory list destroyed Index
ElementUI Date picker quick selection (today, yesterday, this week last week, this month last month, 1234 quarter)
Blog.csdn.net/qq_43440659…