intact-vue
TypeScript icon, indicating that this package has built-in type declarations

3.0.34 • Public • Published

intact-vue

A compatibility layer for running Intact component in Vue-Next.

Usage

import {createApp} from 'vue';
import {Component} from 'intact-vue';

class IntactComponent extends Component {
    static template = `
        <button ev-click={this.onClick.bind(this)}>
            click {this.get('value')}
        </button>
    `;

    onClick() {
        this.set('value', this.get('value') + 1);
        this.trigger('click');
    }
}

const container = document.createElement('div');
document.body.appendChild(container);
createApp({
    data: {
        count: 0,
    },
    template: `<div>
        <IntactComponent @click="onClick" v-model="count"/>
        <div>count: {{ count }}</div>
    </div>`,
    methods: {
        onClick() {
            console.log(this.count);
        }
    },
    components: {IntactComponent}
}).mount(container);

webpack

You can use alias config of webpack to replace intact module.

resolve: {
    alias: {
        'intact$': 'intact-vue'
    }
}

Incompatible

  1. .native modifier is not supported. For example:

    // native modifier
    <IntactComponent @click.native="onClick" />
  2. Multiple values style is not supported.

Dependents (5)

Package Sidebar

Install

npm i intact-vue

Weekly Downloads

77

Version

3.0.34

License

MIT

Unpacked Size

972 kB

Total Files

16

Last publish

Collaborators

  • warrior-bing
  • x6doooo
  • javey
  • lynn.wang
  • ws7she
  • hyuni
  • onlycl