炫意html5
最早CSS3和HTML5移动技术网站之一

[Vue.js 3.0] Migration – Props Default Function this Access

# Props Default Function this Access


breaking

Props default value factory functions no longer have access to this.

Instead:

  • Raw props received by the component are passed to the default function as argument;

  • The inject API can be used inside default functions.

import { inject } from 'vue'
export default {
props: {
theme: {
default (props) {
// `props` is the raw values passed to the component,
// before any type / default coercions
// can also use `inject` to access injected properties
return inject('theme', 'default-theme')
}
}
}
}

炫意HTML5 » [Vue.js 3.0] Migration – Props Default Function this Access

CSS3教程HTML5教程