1.0.2 • Published 3 years ago

vue-pug v1.0.2

Weekly downloads
6
License
GPL-2.0
Repository
github
Last release
3 years ago

#vue-pug Compiles plain pug files into vue.js templates; compatible with webpack


Usage

  • As a webpack loader

webpack.config.js

module.exports = {
    entry: {
        index: {
            import: "src/index.js"
        }
    },
    module: {
        rules: [
            {
                "test": /\.pvue$/,
                "use": [
                    "vue-pug"
                ]
            }
        ]
    }
};

src/template.pvue

h2|Hewwo Wowd! owo
p="You're visiting" + author + "'s page, and currently is " + time + " o'clock :)"

if author != "Matheus Giovani"
    p|Boo, the author is not Matheus Giovani! :(
else
    p|Welcome to the original plugin author page!

each item in items
    p=item.text

src/index.js

const app = new Vue({
    el: "#app",
    template: require("./template.pvue"),
    data: {
        author: "Matheus Giovani",
        time: (new Date()).toLocaleTimeString(),
        items: [
            {
                text: "Test item"
            },
            {
                text: "Second test item"
            }
        ]
    }
});
1.0.2

3 years ago

1.0.1

3 years ago

1.0.11

3 years ago

4.0.0

3 years ago

3.0.0

3 years ago

1.0.0

3 years ago