-
Notifications
You must be signed in to change notification settings - Fork 835
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
Showing
8 changed files
with
114 additions
and
223 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
packages/nutui-taro-demo/src/business/pages/ecard/basic.vue
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,39 @@ | ||
<template> | ||
<nut-cell> | ||
<nut-ecard | ||
v-model="money" | ||
:data-list="dataList" | ||
@input-change="inputChange" | ||
@change="change" | ||
@change-step="changeStep" | ||
></nut-ecard> | ||
</nut-cell> | ||
</template> | ||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
const dataList = ref([ | ||
{ | ||
price: 10 | ||
}, | ||
{ | ||
price: 20 | ||
}, | ||
{ | ||
price: 30 | ||
}, | ||
{ | ||
price: 40 | ||
} | ||
]); | ||
const money = ref(10); | ||
const inputChange = (val: number) => { | ||
money.value = val; | ||
}; | ||
const change = (item: any) => { | ||
money.value = item.price; | ||
}; | ||
const changeStep = (num: number, price: number) => { | ||
const val = price * num; | ||
money.value = val; | ||
}; | ||
</script> |
45 changes: 11 additions & 34 deletions
45
packages/nutui-taro-demo/src/business/pages/ecard/index.vue
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 |
---|---|---|
@@ -1,42 +1,19 @@ | ||
<template> | ||
<Demo> | ||
<h2>基础用法</h2> | ||
<nut-cell> | ||
<nut-ecard | ||
v-model="money" | ||
:data-list="dataList" | ||
@input-change="inputChange" | ||
@change="change" | ||
@change-step="changeStep" | ||
></nut-ecard> | ||
</nut-cell> | ||
<h2>{{ t('basic') }}</h2> | ||
<Basic /> | ||
</Demo> | ||
</template> | ||
<script setup lang="ts"> | ||
import { reactive, ref } from 'vue'; | ||
const dataList = reactive([ | ||
{ | ||
price: 10 | ||
import { useTranslate } from '../../../utils'; | ||
import Basic from './basic.vue'; | ||
const t = useTranslate({ | ||
'zh-CN': { | ||
basic: '基础用法' | ||
}, | ||
{ | ||
price: 20 | ||
}, | ||
{ | ||
price: 30 | ||
}, | ||
{ | ||
price: 40 | ||
'en-US': { | ||
basic: 'Basic Usage' | ||
} | ||
]); | ||
const money = ref(0); | ||
const inputChange = (val: number) => { | ||
money.value = val; | ||
}; | ||
const change = (item: { price: number }) => { | ||
money.value = item.price; | ||
}; | ||
const changeStep = (num: number, price: number) => { | ||
const val = price * num; | ||
money.value = val; | ||
}; | ||
}); | ||
</script> |
This file was deleted.
Oops, something went wrong.
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,39 @@ | ||
<template> | ||
<nut-cell> | ||
<nut-ecard | ||
v-model="money" | ||
:data-list="dataList" | ||
@input-change="inputChange" | ||
@change="change" | ||
@change-step="changeStep" | ||
></nut-ecard> | ||
</nut-cell> | ||
</template> | ||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
const dataList = ref([ | ||
{ | ||
price: 10 | ||
}, | ||
{ | ||
price: 20 | ||
}, | ||
{ | ||
price: 30 | ||
}, | ||
{ | ||
price: 40 | ||
} | ||
]); | ||
const money = ref(10); | ||
const inputChange = (val: number) => { | ||
money.value = val; | ||
}; | ||
const change = (item: any) => { | ||
money.value = item.price; | ||
}; | ||
const changeStep = (num: number, price: number) => { | ||
const val = price * num; | ||
money.value = val; | ||
}; | ||
</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,19 @@ | ||
<template> | ||
<Demo> | ||
<h2>{{ t('basic') }}</h2> | ||
<Basic /> | ||
</Demo> | ||
</template> | ||
<script setup lang="ts"> | ||
import { useTranslate } from '@/sites/utils'; | ||
import Basic from './basic.vue'; | ||
const t = useTranslate({ | ||
'zh-CN': { | ||
basic: '基础用法' | ||
}, | ||
'en-US': { | ||
basic: 'Basic Usage' | ||
} | ||
}); | ||
</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
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
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