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'
      }
    }
  • 相关阅读:
    iOS很重要的 block回调
    怎样写具体设计文档
    ORM框架
    RapidXml用法
    【Android Training
    ORACLE触发器具体解释
    LeetCode 131 Palindrome Partitioning
    Git管理工具对照(GitBash、EGit、SourceTree)
    Android下将图片载入到内存中
    怎样破解邮箱password
  • 原文地址:https://www.cnblogs.com/alexandra/p/6089457.html
Copyright © 2011-2022 走看看