From e4cf24c991ff94e4280597b45deb928f9cb29495 Mon Sep 17 00:00:00 2001 From: mengxiong10 <15623530290@163.com> Date: Thu, 5 Dec 2019 10:58:44 +0800 Subject: [PATCH] chore: optimize the example code --- example/app.js | 10 +++------- example/dev.html | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/example/app.js b/example/app.js index f8f340a..0951a2d 100644 --- a/example/app.js +++ b/example/app.js @@ -120,7 +120,6 @@ const App = { data() { return { lang: 'en', - hackReset: true, currentId: this.getCurrentId(), }; }, @@ -140,10 +139,6 @@ const App = { const lang = this.lang === 'en' ? 'zh-cn' : 'en'; this.lang = lang; this.changeLocale(lang); - this.hackReset = false; - this.$nextTick(() => { - this.hackReset = true; - }); }, }, render(h) { @@ -169,8 +164,8 @@ const App = { {this.lang === 'en' ? '中文' : 'English'} - {this.hackReset && - components.map(item => { +
+ {components.map(item => { const { component, id, code } = item; const props = { id, @@ -180,6 +175,7 @@ const App = { }; return {h(component)}; })} +
); }, diff --git a/example/dev.html b/example/dev.html index eb07127..2b6c079 100644 --- a/example/dev.html +++ b/example/dev.html @@ -6,7 +6,7 @@ Document - +