From feb6785654e86f2cfb39e72099353abeb5092369 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 25 Oct 2017 09:54:21 +0800 Subject: [PATCH] refactor: refine form example --- src/components/MDinput/index.vue | 5 ++ src/mock/article.js | 4 +- src/views/example/form.vue | 81 +++++++++++++++++++------------- 3 files changed, 55 insertions(+), 35 deletions(-) diff --git a/src/components/MDinput/index.vue b/src/components/MDinput/index.vue index 6d9d5e8e..731311f7 100644 --- a/src/components/MDinput/index.vue +++ b/src/components/MDinput/index.vue @@ -71,6 +71,11 @@ export default { } } }, + watch: { + value(newValue) { + this.currentValue = newValue + } + }, data() { return { currentValue: this.value, diff --git a/src/mock/article.js b/src/mock/article.js index f6ed1751..a42030ed 100644 --- a/src/mock/article.js +++ b/src/mock/article.js @@ -50,7 +50,7 @@ export default { author: { key: 'mockPan' }, source_name: '原创作者', category_item: [{ key: 'global', name: '全球' }], - comment_disabled: false, + comment_disabled: true, content: '

我是测试数据我是测试数据

"', content_short: '我是测试数据', display_time: +new Date(), @@ -59,6 +59,6 @@ export default { source_uri: 'https://github.com/PanJiaChen/vue-element-admin', status: 'published', tags: [], - title: '' + title: 'vue-element-admin' }) } diff --git a/src/views/example/form.vue b/src/views/example/form.vue index 9a09c846..c0a0a925 100644 --- a/src/views/example/form.vue +++ b/src/views/example/form.vue @@ -4,27 +4,28 @@