|
@@ -1,7 +1,6 @@
|
|
|
-<!-- -->
|
|
|
<template>
|
|
|
- <div class="role-rItem" v-if="curRole">
|
|
|
- <span v-if="curRole.color" class="adult-book-input-roleText" :style="{ background: this.curRole.color }">{{
|
|
|
+ <div v-if="curRole" class="role-rItem">
|
|
|
+ <span v-if="curRole.color" class="adult-book-input-roleText" :style="{ background: curRole.color }">{{
|
|
|
curRole.name
|
|
|
}}</span>
|
|
|
<img
|
|
@@ -10,9 +9,9 @@
|
|
|
class="adult-book-input-roleImg"
|
|
|
/>
|
|
|
<div
|
|
|
+ v-else-if="curRole.simpleHead !== ''"
|
|
|
class="adult-book-input-roleImg"
|
|
|
:class="['adult-book-input-roleImg' + curRole.simpleHead]"
|
|
|
- v-else-if="curRole.simpleHead !== ''"
|
|
|
></div>
|
|
|
<template v-if="type != 1 && curRole.detail.wordsList.length > 0">
|
|
|
<span class="pinyin" :style="{ color: wordColor }">{{ curRole.detail.wordsList | handlePinyin }}</span>
|
|
@@ -24,13 +23,12 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
components: {},
|
|
|
- props: ['curRole', 'color', 'type'],
|
|
|
filters: {
|
|
|
handlePinyin(wordsList) {
|
|
|
let str = '';
|
|
|
wordsList.forEach((item, index) => {
|
|
|
if (index < wordsList.length - 1) {
|
|
|
- str += item.pinyin + ' ';
|
|
|
+ str += `${item.pinyin} `;
|
|
|
} else {
|
|
|
str += item.pinyin;
|
|
|
}
|
|
@@ -41,7 +39,7 @@ export default {
|
|
|
let str = '';
|
|
|
wordsList.forEach((item, index) => {
|
|
|
if (index < wordsList.length - 1) {
|
|
|
- str += item.chs + ' ';
|
|
|
+ str += `${item.chs} `;
|
|
|
} else {
|
|
|
str += item.chs;
|
|
|
}
|
|
@@ -49,11 +47,12 @@ export default {
|
|
|
return str;
|
|
|
},
|
|
|
},
|
|
|
+ props: ['curRole', 'color', 'type'],
|
|
|
data() {
|
|
|
return {};
|
|
|
},
|
|
|
computed: {
|
|
|
- wordColor: function () {
|
|
|
+ wordColor() {
|
|
|
let color = 'rgba(0,0,0,0.85)';
|
|
|
if (this.color) {
|
|
|
color = this.color;
|
|
@@ -62,19 +61,19 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
watch: {},
|
|
|
- //方法集合
|
|
|
- methods: {},
|
|
|
- //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ // 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {},
|
|
|
- //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ // 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {},
|
|
|
- beforeCreate() {}, //生命周期 - 创建之前
|
|
|
- beforeMount() {}, //生命周期 - 挂载之前
|
|
|
- beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
- updated() {}, //生命周期 - 更新之后
|
|
|
- beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
- destroyed() {}, //生命周期 - 销毁完成
|
|
|
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ beforeCreate() {}, // 生命周期 - 创建之前
|
|
|
+ beforeMount() {}, // 生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, // 生命周期 - 更新之前
|
|
|
+ updated() {}, // 生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, // 生命周期 - 销毁之前
|
|
|
+ destroyed() {}, // 生命周期 - 销毁完成
|
|
|
+ activated() {},
|
|
|
+ // 方法集合
|
|
|
+ methods: {}, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|