按渲染排序是:

setup

beforeCreate

data

created

<script>
import { ref, reactive, toRefs } from 'vue'
export default {
  name: 'App',
  data () {
    console.log('data');
    return {

    }
  },
  methods: {
   
  },
  setup () {
    console.log('setup')
  },
  beforeCreate () { console.log('beforeCreate:数据初始化之前'); },
  created () { console.log('created:数字初始化之后'); },


}
</script>

打印顺序是:

setup

beforeCreate:数据初始化之前

data

created:数字初始化之后

Logo

前往低代码交流专区

更多推荐