Skip to content

Commit

Permalink
fix(price): 修复小程序下符号转义丢失问题
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu committed Jul 24, 2023
1 parent 08fe01a commit 2d08ec2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/packages/__VUE/price/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,17 @@ export default create({
[`${componentName}--strike`]: props.strikeThrough
};
});
const replaceSpecialChar = (url: string) => {
url = url.replace(/"/g, '"');
url = url.replace(/&/g, '&');
url = url.replace(/&lt;/g, '<');
url = url.replace(/&gt;/g, '>');
url = url.replace(/&nbsp;/g, ' ');
url = url.replace(/&yen;/g, '');
return url;
};
const showSymbol = computed(() => {
const symbol = props.needSymbol ? props.symbol : '';
const symbol = props.needSymbol ? replaceSpecialChar(props.symbol) : '';
return symbol;
});
const checkPoint = (price: string | number) => {
Expand Down

0 comments on commit 2d08ec2

Please sign in to comment.