Commit 8e14e98680bc2474df2ee597a38ff7399a1c1745
1 parent
71da5d1c
页面标题
Showing
2 changed files
with
29 additions
and
2 deletions
src/pages/goodDetails/goodDetails.vue
| ... | ... | @@ -186,6 +186,7 @@ export default { |
| 186 | 186 | name: 'goodDetails', |
| 187 | 187 | data () { |
| 188 | 188 | return { |
| 189 | + title: "", // 标题 | |
| 189 | 190 | banner: null, |
| 190 | 191 | goodsInfo: null, |
| 191 | 192 | backs: null, // 后退按钮组 |
| ... | ... | @@ -207,7 +208,22 @@ export default { |
| 207 | 208 | props: [ |
| 208 | 209 | ], |
| 209 | 210 | //对象内部的属性监听,也叫深度监听 |
| 210 | - watch: { | |
| 211 | + head: { | |
| 212 | + title () { | |
| 213 | + return { | |
| 214 | + inner: this.title | |
| 215 | + } | |
| 216 | + } | |
| 217 | + }, | |
| 218 | + watch: { | |
| 219 | + // 设置页面标题 | |
| 220 | + title (newVal) { | |
| 221 | + if (this.$store.state.browser.toLowerCase() == "qq" && this.$store.state.deviceType.toLowerCase() == "iphone") { | |
| 222 | + this.$iFrame.insertIFrame(newVal); | |
| 223 | + } else { | |
| 224 | + this.$emit("updateHead"); | |
| 225 | + } | |
| 226 | + } | |
| 211 | 227 | }, |
| 212 | 228 | //属性的结果会被缓存,除非依赖的响应式属性变化才会重新计算。主要当作属性来使用; |
| 213 | 229 | computed: { | ... | ... |
src/pages/morePoints/morePoints.vue
| ... | ... | @@ -43,6 +43,7 @@ export default { |
| 43 | 43 | name: 'morePoints', |
| 44 | 44 | data () { |
| 45 | 45 | return { |
| 46 | + title: "", // 标题 | |
| 46 | 47 | backs: null, // 后退按钮组 |
| 47 | 48 | loading: true, |
| 48 | 49 | distance: 50, |
| ... | ... | @@ -68,6 +69,16 @@ export default { |
| 68 | 69 | } |
| 69 | 70 | } |
| 70 | 71 | }, |
| 72 | + watch: { | |
| 73 | + // 设置页面标题 | |
| 74 | + title (newVal) { | |
| 75 | + if (this.$store.state.browser.toLowerCase() == "qq" && this.$store.state.deviceType.toLowerCase() == "iphone") { | |
| 76 | + this.$iFrame.insertIFrame(newVal); | |
| 77 | + } else { | |
| 78 | + this.$emit("updateHead"); | |
| 79 | + } | |
| 80 | + } | |
| 81 | + }, | |
| 71 | 82 | //属性的结果会被缓存,除非依赖的响应式属性变化才会重新计算。主要当作属性来使用; |
| 72 | 83 | computed: { |
| 73 | 84 | }, |
| ... | ... | @@ -122,7 +133,7 @@ export default { |
| 122 | 133 | // 解构数据 |
| 123 | 134 | let { data: datas } = res; |
| 124 | 135 | /*设置标题 */ |
| 125 | - // this.$set(this, "title", datas.title); | |
| 136 | + this.$set(this, "title", datas.title); | |
| 126 | 137 | this.$set(this.backs, 'title', datas.title); |
| 127 | 138 | /* 获取商品数据 开始 */ |
| 128 | 139 | if (datas.goods && datas.goods.length) { | ... | ... |