2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-12 14:22:27 +03:00

chore: optimize the example code

This commit is contained in:
mengxiong10
2019-12-05 10:58:44 +08:00
parent 7fcc1df67c
commit e4cf24c991
2 changed files with 4 additions and 8 deletions
+3 -7
View File
@@ -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'}
</button>
</div>
{this.hackReset &&
components.map(item => {
<div key={this.lang}>
{components.map(item => {
const { component, id, code } = item;
const props = {
id,
@@ -180,6 +175,7 @@ const App = {
};
return <Card {...{ props }}>{h(component)}</Card>;
})}
</div>
</Container>
);
},
+1 -1
View File
@@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/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>