Skip to content

Commit

Permalink
chore: optimize the example code
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxiong10 committed Dec 5, 2019
1 parent 7fcc1df commit e4cf24c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ const App = {
data() {
return {
lang: 'en',
hackReset: true,
currentId: this.getCurrentId(),
};
},
Expand All @@ -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) {
Expand All @@ -169,8 +164,8 @@ const App = {
{this.lang === 'en' ? '中文' : 'English'}
</button>
</div>
{this.hackReset &&
components.map(item => {
<div key={this.lang}>
{components.map(item => {
const { component, id, code } = item;
const props = {
id,
Expand All @@ -180,6 +175,7 @@ const App = {
};
return <Card {...{ props }}>{h(component)}</Card>;
})}
</div>
</Container>
);
},
Expand Down
2 changes: 1 addition & 1 deletion example/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/normalize.css" />
<script src="https://polyfill.io/v3/polyfill.js?features=Object.assign,Array.from,Promise,fetch&flags=gated"></script>
<!-- <script src="https://polyfill.io/v3/polyfill.js?features=Object.assign,Array.from,Promise,fetch&flags=gated"></script> -->
</head>
<body>
<div id="app"></div>
Expand Down

0 comments on commit e4cf24c

Please sign in to comment.