| 1 |
- import{c as t,o as e,C as d}from"./vendor.0d0a34e4.js";const o={class:"markdown-body"},r=d('<h1>Price 商品价格</h1><h3>介绍</h3><p>用来对商品价格数值的小数点前后部分应用不同样式,还支持人民币符号、千位分隔符、设置小数点位数等功能。</p><h3>安装</h3><pre><code class="language-javascript">import { createApp } from 'vue';\n//vue\nimport { Price } from '@nutui/nutui';\n//taro\nimport { Price } from '@nutui/nutui-taro';\n\nconst app = createApp();\napp.use(Price);\n\n</code></pre><h2>代码示例</h2><h3>基本用法</h3><pre><code class="language-html"><nut-price :price="1010" :need-symbol="false" :thousands="true" />\n</code></pre><h3>有人民币符号,无千位分隔</h3><pre><code class="language-html"><nut-price :price="10010.01" :need-symbol="true" :thousands="false" />\n</code></pre><h3>带人民币符号,有千位分隔,保留小数点后三位</h3><pre><code class="language-html"><nut-price :price="15213.1221" :decimal-digits="3" :need-symbol="true" :thousands="true" />\n</code></pre><h3>异步随机变更</h3><pre><code class="language-html"><nut-price :price="price" :decimal-digits="3" :need-symbol="true" :thousands="true" />\n</code></pre><pre><code class="language-javascript">setup() {\n const price = ref(0);\n setInterval(() => {\n price.value = Math.random()*10000000;\n }, 1000);\n return {\n price\n };\n}\n</code></pre><h3>Prop</h3><table><thead><tr><th>字段</th><th>说明</th><th>类型</th><th>默认值</th></tr></thead><tbody><tr><td>price</td><td>价格数量</td><td>Number</td><td>0</td></tr><tr><td>need-symbol</td><td>是否需要加上 symbol 符号</td><td>Boolean</td><td>true</td></tr><tr><td>symbol</td><td>符号类型</td><td>String</td><td>¥</td></tr><tr><td>decimal-digits</td><td>小数位位数</td><td>Number</td><td>2</td></tr><tr><td>thousands</td><td>是否按照千分号形式显示</td><td>Boolean</td><td>false</td></tr></tbody></table>',17),u={setup:d=>(d,u)=>(e(),t("div",o,[r]))};export default u;
|