Nerdy Poly Millionaires

    @cerebral/vue

    4.2.1 • Public • Published

    @cerebral/vue

    Vue.js view for Cerebral.

    Install

    npm install @cerebral/vue vue

    Container

    import Vue from 'vue/dist/vue'
    import App from 'cerebral'
    import { Container, connect } from '@cerebral/vue'
    import main from './main'
    
    const app = App(main)
    
    new Vue({
      render: h =>
        h({
          components: {
            Container: Container(app),
            AppComponent: AppComponent
          },
          template: "<Container><AppComponent></AppComponent></Container>"
        })
    }).$mount("#app");

    connect

    MyComponent.js

    import { connect } from '@cerebral/vue'
    import { state, sequence } from 'cerebral'
    
    export default connect(
      {
        foo: state`foo`,
        click: sequence`clicked`
      },
      {
        template: '<div v-on:click="click()">{{foo}}</div>'
      }
    )

    main.js

    import Vue from 'vue/dist/vue'
    import App from 'cerebral'
    import { Container, connect } from '@cerebral/vue'
    import MyComponent from './MyComponent'
    import main from './main'
    
    const app = App(main)
    
    var vue = new Vue({
      el: '#app',
      components: {
        container: Container(app),
        'my-component': MyComponent
      }
    })

    Keywords

    none

    Install

    npm i @cerebral/vue

    DownloadsWeekly Downloads

    545

    Version

    4.2.1

    License

    MIT

    Unpacked Size

    11 kB

    Total Files

    9

    Last publish

    Collaborators

    • cerebral.js
    • christianalfoni
    • guria
    • gbucher
    • henri-hulski
    • fweinb