Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions examples/sites/demos/pc/app/date-panel/basic-usage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,27 @@
</div>
</template>

<script setup>
import { ref } from 'vue'
<script>
import { TinyDatePanel, TinyDateRange, TinyMonthRange, TinyYearRange } from '@opentiny/vue'

const value = ref('2025-01-15')
const month = ref('2025-01')
const year = ref('2025')
const value1 = ref(['2025-01-15', '2025-02-15'])
const value2 = ref(['2024-03', '2025-02'])
const value3 = ref(['2024', '2028'])
export default {
components: {
TinyDatePanel,
TinyDateRange,
TinyMonthRange,
TinyYearRange
},
data() {
return {
value: '2025-01-15',
month: '2025-01',
year: '2025',
value1: ['2025-01-15', '2025-02-15'],
value2: ['2024-03', '2025-02'],
value3: ['2024', '2028']
}
}
}
</script>

<style scoped lang="less">
Expand Down
28 changes: 19 additions & 9 deletions examples/sites/demos/pc/app/date-panel/custom-weeks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,27 @@
</div>
</template>

<script setup>
import { ref } from 'vue'
<script>
import { TinyDatePanel, TinyDateRange } from '@opentiny/vue'

const value = ref('2025-01-15')
const value1 = ref(['2025-01-15', '2025-02-15'])
const eachWeekFirstDay = ref([])

const formatWeeks = (customWeeks, weekFirstDays) => {
eachWeekFirstDay.value = weekFirstDays
return customWeeks + 'w'
export default {
components: {
TinyDatePanel,
TinyDateRange
},
data() {
return {
value: '2025-01-15',
value1: ['2025-01-15', '2025-02-15'],
eachWeekFirstDay: []
}
},
methods: {
formatWeeks(customWeeks, weekFirstDays) {
this.eachWeekFirstDay = weekFirstDays
return customWeeks + 'w'
}
}
}
</script>

Expand Down
48 changes: 29 additions & 19 deletions examples/sites/demos/pc/app/date-panel/disabled-date.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,37 @@
</div>
</template>

<script setup>
import { ref } from 'vue'
<script>
import { TinyDatePanel, TinyDateRange, TinyMonthRange, TinyYearRange } from '@opentiny/vue'

const value = ref('2025-01-15')
const month = ref('2025-06')
const year = ref('2025')
const value1 = ref(['2025-01-15', '2025-02-15'])
const value2 = ref(['2024-03', '2025-02'])
const value3 = ref(['2024', '2028'])

const disabledDate = (val) => {
return val.getFullYear() < 2025
}

const disabledDate1 = (val) => {
return (val.getFullYear() < 2025 && val.getMonth() < 1) || val.getFullYear() < 2024
}

const disabledDate2 = (val) => {
return val.getFullYear() < 2024
export default {
components: {
TinyDatePanel,
TinyDateRange,
TinyMonthRange,
TinyYearRange
},
data() {
return {
value: '2025-01-15',
month: '2025-06',
year: '2025',
value1: ['2025-01-15', '2025-02-15'],
value2: ['2024-03', '2025-02'],
value3: ['2024', '2028']
}
},
methods: {
disabledDate(val) {
return val.getFullYear() < 2025
},
disabledDate1(val) {
return (val.getFullYear() < 2025 && val.getMonth() < 1) || val.getFullYear() < 2024
},
disabledDate2(val) {
return val.getFullYear() < 2024
}
}
}
</script>

Expand Down
69 changes: 38 additions & 31 deletions examples/sites/demos/pc/app/date-panel/event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,46 @@
</div>
</template>

<script setup>
import { ref } from 'vue'
<script>
import { TinyDatePanel, TinyDateRange, TinyMonthRange, TinyYearRange, TinyModal } from '@opentiny/vue'

const value = ref('2025-01-15')
const month = ref('2025-01')
const year = ref('2025')
const value1 = ref(['2025-01-15', '2025-02-15'])
const value2 = ref(['2024-03', '2025-02'])
const value3 = ref(['2024', '2028'])

const handleSelectChange = (value) => {
TinyModal.message({ message: '触发 面板选中 事件,组件绑定值为:' + value, status: 'info' })
}

const handleSelectChangeMonth = (value) => {
TinyModal.message({ message: '触发 月份面板选中 事件,组件绑定值为:' + value, status: 'info' })
}

const handleSelectChangeYear = (value) => {
TinyModal.message({ message: '触发 年份面板选中 事件,组件绑定值为:' + value, status: 'info' })
}

const handleSelectChange1 = (value) => {
TinyModal.message({ message: '触发 区间面板选中 事件,组件绑定值为:' + value, status: 'info' })
}

const handleSelectChange2 = (value) => {
TinyModal.message({ message: '触发 月份区间面板选中 事件,组件绑定值为:' + value, status: 'info' })
}

const handleSelectChange3 = (value) => {
TinyModal.message({ message: '触发 年份区间面板选中 事件,组件绑定值为:' + value, status: 'info' })
export default {
components: {
TinyDatePanel,
TinyDateRange,
TinyMonthRange,
TinyYearRange
},
data() {
return {
value: '2025-01-15',
month: '2025-01',
year: '2025',
value1: ['2025-01-15', '2025-02-15'],
value2: ['2024-03', '2025-02'],
value3: ['2024', '2028']
}
},
methods: {
handleSelectChange(value) {
TinyModal.message({ message: '触发 面板选中 事件,组件绑定值为:' + value, status: 'info' })
},
handleSelectChangeMonth(value) {
TinyModal.message({ message: '触发 月份面板选中 事件,组件绑定值为:' + value, status: 'info' })
},
handleSelectChangeYear(value) {
TinyModal.message({ message: '触发 年份面板选中 事件,组件绑定值为:' + value, status: 'info' })
},
handleSelectChange1(value) {
TinyModal.message({ message: '触发 区间面板选中 事件,组件绑定值为:' + value, status: 'info' })
},
handleSelectChange2(value) {
TinyModal.message({ message: '触发 月份区间面板选中 事件,组件绑定值为:' + value, status: 'info' })
},
handleSelectChange3(value) {
TinyModal.message({ message: '触发 年份区间面板选中 事件,组件绑定值为:' + value, status: 'info' })
}
}
}
</script>

Expand Down
20 changes: 15 additions & 5 deletions examples/sites/demos/pc/app/date-panel/format.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,23 @@
</div>
</template>

<script setup>
import { ref } from 'vue'
<script>
import { TinyDatePanel, TinyDateRange, TinyMonthRange } from '@opentiny/vue'

const value = ref('2025/01/15')
const value1 = ref(['2025/01/15', '2025/02/15'])
const value2 = ref(['2024/03', '2025/02'])
export default {
components: {
TinyDatePanel,
TinyDateRange,
TinyMonthRange
},
data() {
return {
value: '2025/01/15',
value1: ['2025/01/15', '2025/02/15'],
value2: ['2024/03', '2025/02']
}
}
}
</script>

<style scoped lang="less">
Expand Down
27 changes: 19 additions & 8 deletions examples/sites/demos/pc/app/date-panel/readonly.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,27 @@
</div>
</template>

<script setup>
import { ref } from 'vue'
<script>
import { TinyDatePanel, TinyDateRange, TinyMonthRange, TinyYearRange } from '@opentiny/vue'

const value = ref('2025-01-15')
const month = ref('2025-01')
const year = ref('2025')
const value1 = ref(['2025-01-15', '2025-02-15'])
const value2 = ref(['2024-03', '2025-02'])
const value3 = ref(['2024', '2028'])
export default {
components: {
TinyDatePanel,
TinyDateRange,
TinyMonthRange,
TinyYearRange
},
data() {
return {
value: '2025-01-15',
month: '2025-01',
year: '2025',
value1: ['2025-01-15', '2025-02-15'],
value2: ['2024-03', '2025-02'],
value3: ['2024', '2028']
}
}
}
</script>

<style scoped lang="less">
Expand Down
Loading
Loading