vue3全局混入

main.js

const app = createSSRApp(App)
app.mixin({
		data() {
			return {
				myOption: 'hello!'
			}
		},
		methods: {
			goWhat(e) { //显示不同的页面
				this.showWhat = e
			},
			goMusicDetail(e) { //显示歌曲详情页
				this.showWhat = "detail"
				this.detailId = e.id
			},
			goListDetail(e) { //显示歌单详情页
				this.showWhat = "songlistDetail"
				this.SonglistDetailId = e.id
				// console.log(this.SonglistDetailId)
			},
			playOne(data) { //单曲播放
				this.$refs.player.playOne(data)
			},
			playList(data) { //播放歌单列表音乐
				console.log('playList')
				this.$refs.player.playList(data)
			}
		}
	})
Posted in VUE

One thought on “vue3全局混入

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注