ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
一:Vue.prototype 变为 app.config.globalProperties ~~~ // 之前 - Vue 2 Vue.prototype.$http = () => {} // 之后 - Vue 3 const app = createApp({}) app.config.globalProperties.$http = () => {} ~~~ 二:Vue.extend 移除 使用 createApp代替 ~~~ // 之前 - Vue 2 // 创建构造器 const Profile = Vue.extend({ template: '<p>{{firstName}} {{lastName}} aka {{alias}}</p>', data() { return { firstName: 'Walter', lastName: 'White', alias: 'Heisenberg' } } }) // 创建一个 Profile 的实例,并将它挂载到一个元素上 new Profile().$mount('#mount-point') ~~~ ~~~ // 之后 - Vue 3 const Profile = { template: '<p>{{firstName}} {{lastName}} aka {{alias}}</p>', data() { return { firstName: 'Walter', lastName: 'White', alias: 'Heisenberg' } } } Vue.createApp(Profile).mount('#mount-point') ~~~