|
|
|
|
@ -19,7 +19,7 @@ export default {
|
|
|
|
|
list: { type: Array, default: () => [] },
|
|
|
|
|
noScroll: { type: Boolean, default: true },
|
|
|
|
|
current: { type: Number, default: 0 },
|
|
|
|
|
activeColor: { type: String, default: getApp().globalData.themeColor },
|
|
|
|
|
activeColor: { type: String, default: "" },
|
|
|
|
|
fontSize: { type: [String, Number], default: 32 },
|
|
|
|
|
activeFontWeight: { type: [String, Number], default: 600 },
|
|
|
|
|
normalColor: { type: String, default: "#333333" },
|
|
|
|
|
@ -33,7 +33,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
uni.$on('themeChanged', (color) => {
|
|
|
|
|
if (!this.activeColor || this.activeColor === this.currentActiveColor) {
|
|
|
|
|
if (!this.activeColor) {
|
|
|
|
|
this.currentActiveColor = color;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -41,6 +41,13 @@ export default {
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
uni.$off('themeChanged');
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
activeColor(newVal) {
|
|
|
|
|
if (newVal) {
|
|
|
|
|
this.currentActiveColor = newVal;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
activeIndex() {
|
|
|
|
|
return this.current;
|
|
|
|
|
|