-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b4e9ad
commit 6a140a5
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<template> | ||
<view | ||
class="pi-width-100P" | ||
:style="[customStyle, { height: `${statusBarHeight}px`, background: background }]" | ||
:class="[customClass]" | ||
/> | ||
</template> | ||
|
||
<script> | ||
import ValueSync from '../../mixin/value-sync' | ||
import { getConfig } from '../../config' | ||
const { countDwon } = getConfig() | ||
const TAG = 'PiCountDown' | ||
export default { | ||
name: TAG, | ||
// 混入v-model | ||
mixins: [ValueSync], | ||
props: { | ||
// 初始值,接收一个时间戳 | ||
value: { | ||
required: false | ||
}, | ||
// 自定义样式,对象形式(默认值:{}) | ||
customStyle: { | ||
type: Object, | ||
default() { | ||
return countDwon.customStyle | ||
} | ||
}, | ||
// 自定义样式类,字符串形式('') | ||
customClass: { | ||
type: String, | ||
default() { | ||
return countDwon.customClass | ||
} | ||
}, | ||
autoplay: { | ||
type: Boolean, | ||
default() { | ||
return countDwon.autoplay | ||
} | ||
} | ||
}, | ||
watch: { | ||
value: { | ||
deep: true, | ||
immediate: true, | ||
handler(value) { | ||
this.autoplay && this.run() | ||
} | ||
} | ||
}, | ||
methods: { | ||
run() {} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default { | ||
customClass: '', // 自定义样式类,字符串形式('') | ||
customStyle: {}, // 自定义样式,对象形式(默认值:{}) | ||
autoplay: true // 是否自动开始倒计时,如果为false,需手动调用开始方法 | ||
} |