zoukankan      html  css  js  c++  java
  • vuejs

    When using .vue file for my custom components it throws an vue warning.
    [Vue warn]: Failed to mount component: template or render function not defined. (found in root instance)

    https://vuejs.org/v2/guide/installation.html

    Standalone vs. Runtime-only Build

    There are two builds available, the standalone build and the runtime-only build. The difference being that the former includes the template compiler and the latter does not.

    The template compiler is responsible for compiling Vue template strings into pure JavaScript render functions. If you want to use the template option, then you need the compiler.

    • The standalone build includes the compiler and supports the template option. It also relies on the presence of browser APIs so you cannot use it for server-side rendering.

    • The runtime-only build does not include the template compiler, and does not support the template option. You can only use the render option when using the runtime-only build, but it works with single-file components, because single-file components’ templates are pre-compiled into render functions during the build step. The runtime-only build is roughly 30% lighter-weight than the standalone build, weighing only 16.39kb min+gzip.

    By default, the NPM package exports the runtime-only build. To use the standalone build, add the following alias to your Webpack config:

    resolve: {
      alias: {
        'vue$': 'vue/dist/vue.js'
      }
    }
  • 相关阅读:
    修改用户密码,权限
    域渗透
    跨域
    目录
    C中的extern和static
    XSS进阶
    SQL injection
    双重指针学习笔记
    文件上传学习笔记
    Hello Python
  • 原文地址:https://www.cnblogs.com/alexandra/p/6089457.html
Copyright © 2011-2022 走看看