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:
+3
-7
@@ -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
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user