Code Monkey home page Code Monkey logo

vue-element's Issues

inline-template

Vue components have option to use inline templates (http://vuejs.org/guide/components.html#Inline_Template). It would be nice to emulate this feature using vue-element.

We can do this changing createdCallback like this:

const isInlineTemplate = !!Array.from(this.attributes).find((element) => {
    return element.name === 'inline-template';
});

if (isInlineTemplate) {
    options.template = this.innerHTML;
}
// Define the Vue constructor to manage the element
let VM = Vue.extend(options)

Regards.

Problem when using webcomponents.js in firefox

PS: Actually, now I tested without vue-elements and the problem is in vue.js and not in vue-elements, so I already open a issue in Vue.js

I'm using the latest version of vuejs, vue-element and webcomponents.js and when I try to load a simple component in firefox he throws a error com console.

example.html

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="bower_components/webcomponentsjs/webcomponents.js"></script>
    <script src="bower_components/vue/dist/vue.js"></script>
    <script src="bower_components/vue-element/vue-element.js"></script>
</head>
<body>
<my-component></my-component>
</body>
<script>
    Vue.element('my-component', {
        template: '<span> Hello From My {{ name  } }Component </span>',
        data: function(){
            return {
                name: ' test '
            }
        },
        shadow: true
    });

    var vue = new Vue({
        el: 'body',
    });
</script>
</html>

bower.json dependencies

  "dependencies": {
    "vue": "~0.12",
    "vue-element": "~1.0.1",
    "webcomponentsjs": "~0.7.5"
  }

console log

TypeError: text.replace is not a function - vue.js:2790:0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.