NativeScript-Vue - 组件不刷新但 app.js 刷新

NativeScript-Vue - Components not refreshing but app.js does

有一个非常奇怪的问题,即导入到 app.js 的组件,当对其进行更改时不会 refresh/reload,但对 app.js 所做的更改会反映在模拟器中还有我的 phone.

因此,如果我更改导航组件中的某些内容,则什么也不会发生。如果我更改 ActionBar 标题,更改会反映出来,但导航中的第一个更改仍然没有。

只有在我重新加载整个项目时才会生效。

<template>
    <Page>
        <ActionBar title="Welcome to the Shop"/>
        <GridLayout columns="*" rows="*">
            <Label class="message" :text="msg" col="0" row="0"/>
            <navigation></navigation>
        </GridLayout>
    </Page>
</template>

<script>
import navigation from '@/components/navigation/Master.vue';

  export default {
    components: {
        'navigation': navigation
    },
    data() {
      return {
        msg: 'Hello World! This is Big D.'
      }
    }
  }
</script>

实际上,Webpack 过去常常观察 Nativescript 中的这些变化,并且在重新渲染原生元素方面还没有成熟。我也经常遇到这个问题!我观察到这曾经发生在我曾经看过他们教程的人身上。

如果您在您的应用程序中添加或删除任何文件,您需要删除平台文件夹和 运行 tns run 命令。

但我建议你使用 Sidekick,因为它使用 HMR,它比普通的 tns cli 工作得更好。使用起来舒服多了。这是 link SideKick