-
Notifications
You must be signed in to change notification settings - Fork 1
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
12 changed files
with
529 additions
and
564 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,22 @@ | ||
# 告诉EditorConfig插件,这是根文件,不用继续往上查找 | ||
root = true | ||
|
||
# 匹配全部文件 | ||
[*] | ||
# 设置字符集 | ||
charset = utf-8 | ||
# 缩进风格,可选space、tab | ||
indent_style = space | ||
# 缩进的空格数 | ||
indent_size = 2 | ||
# 结尾换行符,可选lf、cr、crlf | ||
end_of_line = lf | ||
# 在文件结尾插入新行 | ||
insert_final_newline = true | ||
# 删除一行中的前后空格 | ||
trim_trailing_whitespace = true | ||
|
||
# 匹配md结尾的文件 | ||
[*.md] | ||
insert_final_newline = false | ||
trim_trailing_whitespace = false |
54 changes: 54 additions & 0 deletions
54
yudao-ui-app/components/custom-text-price/custom-text-price.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,54 @@ | ||
<template> | ||
<view class="u-text-price-wrap"> | ||
<text v-for="(item, index) in textArray" :key="index" :style="{ 'font-size': (index === 1 ? integerSize : size) + 'px', 'color': color }"> | ||
{{ item }} | ||
</text> | ||
</view> | ||
</template> | ||
|
||
<script> | ||
/** | ||
* 此组件存在只为简单的显示特定样式的(人名币)价格数字 | ||
*/ | ||
export default { | ||
name: 'custom-text-price', | ||
components: {}, | ||
props: { | ||
price: { | ||
type: [String, Number], | ||
default: '0.00' | ||
}, | ||
color: { | ||
type: String, | ||
default: '#333333' | ||
}, | ||
//字体大小 | ||
size: { | ||
type: [String, Number], | ||
default: 15 | ||
}, | ||
//整形部分字体大小可单独定义 | ||
intSize: { | ||
type: [String, Number], | ||
default: 15 | ||
} | ||
}, | ||
computed: { | ||
textArray() { | ||
let array = ['¥'] | ||
if (!/^\d+(\.\d+)?$/.test(this.price)) { | ||
console.error('组件<custom-text-price :text="???" 此处参数应为金额数字') | ||
} else { | ||
let arr = parseFloat(this.price).toFixed(2).split('.') | ||
array.push(arr[0]) | ||
array.push('.' + arr[1]) | ||
} | ||
return array | ||
}, | ||
integerSize() { | ||
return this.intSize ? this.intSize : this.size | ||
} | ||
} | ||
} | ||
</script> | ||
<style></style> |
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,24 +1,17 @@ | ||
<template> | ||
<view class="container"> | ||
|
||
</view> | ||
<view class="container"> </view> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
title: '' | ||
} | ||
}, | ||
onLoad() { | ||
}, | ||
methods: { | ||
} | ||
} | ||
export default { | ||
data() { | ||
return { | ||
title: '' | ||
} | ||
}, | ||
onLoad() {}, | ||
methods: {} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
</style> | ||
<style lang="scss" scoped></style> |
Oops, something went wrong.