-
Notifications
You must be signed in to change notification settings - Fork 834
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
18 changed files
with
153 additions
and
265 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
packages/nutui-taro-demo/src/exhibition/pages/price/decimal.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,3 @@ | ||
<template> | ||
<nut-price :price="8888" :decimal-digits="0" /> | ||
</template> |
79 changes: 43 additions & 36 deletions
79
packages/nutui-taro-demo/src/exhibition/pages/price/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,43 +1,50 @@ | ||
<template> | ||
<Demo> | ||
<nut-cell-group title="支持三种尺寸:small、normal、large"> | ||
<nut-cell> | ||
<nut-price :price="0" size="small" :need-symbol="false" /> | ||
</nut-cell> | ||
<nut-cell> | ||
<nut-price :price="0" size="normal" :need-symbol="false" /> | ||
</nut-cell> | ||
<nut-cell> | ||
<nut-price :price="0" size="large" :need-symbol="false" /> | ||
</nut-cell> | ||
</nut-cell-group> | ||
<h2>不保留小数</h2> | ||
<nut-cell> | ||
<nut-price :price="8888" :decimal-digits="0" /> | ||
</nut-cell> | ||
<h2>划线价</h2> | ||
<nut-cell> | ||
<nut-price :price="8888" :decimal-digits="0" size="normal" need-symbol thousands strike-through /> | ||
</nut-cell> | ||
<h2>货币符号</h2> | ||
<nut-cell> | ||
<nut-price :price="10010.01" symbol="¥" /> | ||
</nut-cell> | ||
<h2>货币符号位置</h2> | ||
<nut-cell> | ||
<nut-price :price="8888.01" position="after" symbol="元" /> | ||
</nut-cell> | ||
<h2>千位分隔</h2> | ||
<nut-cell> | ||
<nut-price :price="15213.1221" :decimal-digits="3" thousands /> | ||
</nut-cell> | ||
<h2>{{ t('size') }}</h2> | ||
<Size /> | ||
|
||
<h2>{{ t('decimal') }}</h2> | ||
<Decimal /> | ||
|
||
<h2>{{ t('through') }}</h2> | ||
<Through /> | ||
|
||
<h2>{{ t('symbol') }}</h2> | ||
<Symbol /> | ||
|
||
<h2>{{ t('position') }}</h2> | ||
<Position /> | ||
|
||
<h2>{{ t('title5') }}</h2> | ||
<Thousands /> | ||
</Demo> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
const price = ref(0); | ||
setInterval(() => { | ||
price.value = Math.random() * 10000000; | ||
}, 1000); | ||
import { useTranslate } from '../../../utils'; | ||
import Size from './size.vue'; | ||
import Decimal from './decimal.vue'; | ||
import Through from './through.vue'; | ||
import Symbol from './symbol.vue'; | ||
import Position from './position.vue'; | ||
import Thousands from './thousands.vue'; | ||
const t = useTranslate({ | ||
'zh-CN': { | ||
size: '尺寸', | ||
decimal: '不保留小数', | ||
through: '划线价', | ||
symbol: '货币符号', | ||
position: '货币符号位置', | ||
title5: '千位分隔' | ||
}, | ||
'en-US': { | ||
size: 'Size', | ||
decimal: 'No decimals', | ||
through: 'Strike Through', | ||
symbol: 'Currency symbol', | ||
position: 'Currency symbol position', | ||
title5: 'Separated by thousands' | ||
} | ||
}); | ||
</script> |
3 changes: 3 additions & 0 deletions
3
packages/nutui-taro-demo/src/exhibition/pages/price/position.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,3 @@ | ||
<template> | ||
<nut-price :price="8888.01" position="after" symbol="RMB" /> | ||
</template> |
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 @@ | ||
<template> | ||
<nut-price :price="0" size="large" /> | ||
<nut-price :price="0" size="normal" /> | ||
<nut-price :price="0" size="small" /> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
packages/nutui-taro-demo/src/exhibition/pages/price/symbol.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,3 @@ | ||
<template> | ||
<nut-price :price="10010.01" symbol="$" /> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
packages/nutui-taro-demo/src/exhibition/pages/price/thousands.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,3 @@ | ||
<template> | ||
<nut-price :price="15213.1221" :decimal-digits="3" thousands /> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
packages/nutui-taro-demo/src/exhibition/pages/price/through.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,3 @@ | ||
<template> | ||
<nut-price :price="8888" :decimal-digits="0" strike-through /> | ||
</template> |
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,3 @@ | ||
<template> | ||
<nut-price :price="8888" :decimal-digits="0" /> | ||
</template> |
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,50 @@ | ||
<template> | ||
<Demo> | ||
<h2>{{ t('size') }}</h2> | ||
<Size /> | ||
|
||
<h2>{{ t('decimal') }}</h2> | ||
<Decimal /> | ||
|
||
<h2>{{ t('through') }}</h2> | ||
<Through /> | ||
|
||
<h2>{{ t('symbol') }}</h2> | ||
<Symbol /> | ||
|
||
<h2>{{ t('position') }}</h2> | ||
<Position /> | ||
|
||
<h2>{{ t('title5') }}</h2> | ||
<Thousands /> | ||
</Demo> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { useTranslate } from '@/sites/utils'; | ||
import Size from './size.vue'; | ||
import Decimal from './decimal.vue'; | ||
import Through from './through.vue'; | ||
import Symbol from './symbol.vue'; | ||
import Position from './position.vue'; | ||
import Thousands from './thousands.vue'; | ||
const t = useTranslate({ | ||
'zh-CN': { | ||
size: '尺寸', | ||
decimal: '不保留小数', | ||
through: '划线价', | ||
symbol: '货币符号', | ||
position: '货币符号位置', | ||
title5: '千位分隔' | ||
}, | ||
'en-US': { | ||
size: 'Size', | ||
decimal: 'No decimals', | ||
through: 'Strike Through', | ||
symbol: 'Currency symbol', | ||
position: 'Currency symbol position', | ||
title5: 'Separated by thousands' | ||
} | ||
}); | ||
</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,3 @@ | ||
<template> | ||
<nut-price :price="8888.01" position="after" symbol="RMB" /> | ||
</template> |
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 @@ | ||
<template> | ||
<nut-price :price="0" size="large" /> | ||
<nut-price :price="0" size="normal" /> | ||
<nut-price :price="0" size="small" /> | ||
</template> |
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,3 @@ | ||
<template> | ||
<nut-price :price="10010.01" symbol="$" /> | ||
</template> |
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,3 @@ | ||
<template> | ||
<nut-price :price="15213.1221" :decimal-digits="3" thousands /> | ||
</template> |
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,3 @@ | ||
<template> | ||
<nut-price :price="8888" :decimal-digits="0" strike-through /> | ||
</template> |
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
Oops, something went wrong.