Socket
Book a DemoInstallSign in
Socket

@tinajs/mina-sfc

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinajs/mina-sfc

mina single-file-component for wechat mini program, inspried by vue.js

latest
Source
npmnpm
Version
0.2.2
Version published
Weekly downloads
43
48.28%
Maintainers
1
Weekly downloads
 
Created
Source

mina-sfc

mina single-file-component for wechat mini program, inspried by vue.js

npm license PRs Welcome

Installation

npm i --save @tinajs/mina-sfc

Usage

node.js:

const { parse } = require('@tinajs/mina-sfc')

console.log(parse(`
  <config>{}</config>
  <script>console.log('meow~')</script>
`))

output:

{
  "_blocks": [{
    "type": "config",
    "content": "{}",
    "attributes": {}
  }, {
    "type": "script",
    "content": "console.log('meow~')",
    "attributes": {}
  }],
  "config": {
    "type": "config",
    "content": "{}",
    "attributes": {}
  },
  "script": {
    "type": "script",
    "content": "console.log('meow~')",
    "attributes": {}
  },
  "style": null,
  "template": null
}

API

parse(source:String)

Returns sfc object

Mina SFC Object

Block Struct

  • type

    The tag name

  • content

    The raw content

  • attributes

    The attributes object ([name]: value)

Special Block

  • config
  • style
  • template
  • script

License

MIT © yelo, 2017 - present

FAQs

Package last updated on 02 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts