javascript - 加载页面后,从 VueJS 中的“方法”调用“创建”函数
问题描述
我是Vue JS 新手 我的 VueJS 应用程序结构是这样的
<template>
<div>
//HTML CODE
</div>
</template>
<script>
export default {
data() {
return {
},
methods: {
functionABC(){
// CAN I CALL created() in this function ?
}
},
created() {
//SOME FUNCTIONS
}
};
</script>
<style scoped>
</style>
我知道我可以在 created() 中为首页加载时发生的所有操作创建一个函数,然后在每次需要时调用该函数,这也将达到目的,但我实际上想知道调用 created() 的正确方法) 功能,即使在页面加载后
解决方案
I think that you can't. If there is a way to do it I think that is not recommended. You should do a function and call it from created or from another function to not duplicate code
推荐阅读
- airflow - 气流修改后的安全性未按预期工作
- python - 遍历字典并根据其内容计算结果
- javascript - 嵌套动态路由 getServerSideProps
- amazon-web-services - 如何在 AWS Cognito 中实施组限制访问
- angular - 问题绑定管道异步客栈自定义指令输入
- c# - 如何在 Azure Synapse C# 笔记本中安装包?
- typescript - 我可以根据打字稿中的数组元素创建新类型吗?
- docker - docker容器内的网络路由
- html - Django:html django模板中的OPENPYXL数据
- amazon-cloudformation - aws-cdk 从另一个堆栈中使用的堆栈中删除资源