GithubHelp home page GithubHelp logo

christianbielak / vue-pagebuilder Goto Github PK

View Code? Open in Web Editor NEW
18.0 7.0 4.0 361 KB

Vue Pagebuilder Component for Laravel and Vue SPA

License: MIT License

JavaScript 0.66% TypeScript 45.20% Vue 43.08% SCSS 11.06%
vuejs typescript pagebuilder laravel vue-spa vue

vue-pagebuilder's Introduction



Vue Pagebuilder

Demo

Dashboard

Frontend Demo coming soon...

Notes

This package is still in development and is NOT yet intended for production use.
The README for customization will be coming soon.

Installtion

npm install @chrisbielak/vue-pagebuilder

or use yarn

yarn add @chrisbielak/vue-pagebuilder

Set up TypeScript

The Pagebuilder was written in TypeScript, which will be installed automatically with all required dependencies.

You can skip this step if you want to use the Pagebuilder within a TypeScript ready Vue.js SPA.

If you want to use it in a Laravel project you have to make the project TypeScript ready.

First of all you have to modify your webpack.mix.json.

...

  module:{
         rules:[
             {
                 test: /\.tsx?$/,
                 loader: "ts-loader",
                 exclude: /node_modules/
             }
         ]
     },
     resolve: {
         extensions: ['*', '.js', '.jsx', '.vue', '.ts', '.tsx'],
 
         alias:{
             '@': path.resolve(__dirname, './resources/js')
         }
     },
     
...

Because of dynamic importing of the Pagebuilder elements it's recommended to define a path for the chunk files.

A simple implementation can look like this:

let chunkFilename = 'js/chunks/[name].js';
mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css');
mix.webpackConfig({
    output: {
        publicPath: '/',
        chunkFilename: chunkFilename
    },
    module:{
        rules:[
            {
                test: /\.tsx?$/,
                loader: "ts-loader",
                exclude: /node_modules/
            }
        ]
    },
    resolve: {
        extensions: ['*', '.js', '.jsx', '.vue', '.ts', '.tsx'],

        alias:{
            '@': path.resolve(__dirname, './resources/js')
        }
    },
});

The last step that needs to be done is to create the tsconfig.json file.

I use the default tsconfig.json which is created by the Vue cli.

{
    "compilerOptions": {
        "target": "esnext",
        "module": "esnext",
        "strict": true,
        "jsx": "preserve",
        "importHelpers": true,
        "moduleResolution": "node",
        "experimentalDecorators": true,
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        "strictPropertyInitialization": false,
        "sourceMap": true,
        "baseUrl": ".",
        "declaration": false,
        "types": [
        ],
        "paths": {
            "@/*": [
                "resources/js/*"
            ]
        },
        "lib": [
            "esnext",
            "dom",
            "dom.iterable",
            "scripthost"
        ]
    },
    "include": [
        "resources/**/*.ts",
        "resources/**/*.tsx",
        "resources/**/*.vue"
    ],
    "exclude": [
        "node_modules"
    ]
}

How to use the Pagebuilder

First you have to register the component and register the Vuex store which has a default set up.

import PagebuilderComponent from "./pagebuilder/components/PagebuilderComponent/PagebuilderComponent";
import store from './pagebuilder/store/store'

new Vue({
    el: '#app',
    components: {
        PagebuilderComponent,
    },
    store
});

Now you can use the pagebuilder-component inside your project wherever it's needed.

<pagebuilder-component></pagebuilder-component>

vue-pagebuilder's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-pagebuilder's Issues

Demo

It would be great to see a demo of the page builder, or even just some screenshots :)

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.