chore: demo ts (#8160)

* chore: demo ts

* chore: fix
This commit is contained in:
neverland
2021-02-14 19:50:45 +08:00
committed by GitHub
parent 8cbf153073
commit a8060bb599
20 changed files with 96 additions and 79 deletions
+6 -5
View File
@@ -40,9 +40,10 @@
</demo-block>
</template>
<script>
<script lang="ts">
import { ref } from 'vue';
import { useTranslate } from '@demo/use-translate';
import { ComponentInstance } from '../../utils';
import Toast from '../../toast';
const i18n = {
@@ -74,16 +75,16 @@ export default {
setup() {
const t = useTranslate(i18n);
const time = ref(30 * 60 * 60 * 1000);
const countDown = ref(null);
const countDown = ref<ComponentInstance>();
const start = () => {
countDown.value.start();
countDown.value?.start();
};
const pause = () => {
countDown.value.pause();
countDown.value?.pause();
};
const reset = () => {
countDown.value.reset();
countDown.value?.reset();
};
const onFinish = () => Toast(t('finished'));