Home

Awesome

tina-modal

:speech_balloon: Modal plugin for Tina.js

npm license PRs Welcome

Setup

  1. Download package from npm
# ensure wxio is installed
npm i -save wxio

# install tina-modal
npm i --save @tinajs/tina-modal
  1. Install into Tina
// app.js
import Tina from '@tinajs/tina'
import modal from '@tinajs/tina-modal'

Tina.use(modal)

Usage

// pages/some-page.js
import { Page } from '@tinajs/tina'
Page.define({
  methods: {
    onSubmit () {
      this.$confirm({ content: 'Submit?' })
        .then(() => this.$alert({ content: 'Confirmed!' }), () => { /* ignore the cancel error */ })
    }
  },
})

API

Page and Component Injections

$alert(options)

$confirm(options)

License

MIT @ yelo