https://github.com/realign/vue-sfc-descriptor-stringify
https://github.com/realign/vue-sfc-descriptor-stringify
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/realign/vue-sfc-descriptor-stringify
- Owner: ReAlign
- Created: 2019-08-07T01:52:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-07T08:41:09.000Z (almost 6 years ago)
- Last Synced: 2025-03-26T09:03:40.590Z (about 2 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vue-sfc-descriptor-stringify
> Translate Vue SFC descriptor to String.
> 将 vue-sfc 描述 转为 字符串。## Scene
需要操作 `vue` 文件,进行 `属性` 或者 `内容` 的更改,类似 `babel`。
## Usage
### Install
```bash
# install
$ npm i vue-sfc-descriptor-stringify -D
```### Call
```js
const Stringify = require('vue-sfc-descriptor-stringify');/**
* @name Stringify
* @param
* sfcDescriptor 需要转换成 string 的 sfc
* originSfcDescriptor 原始 sfc,如果没有对 sfcDescriptor 处理的话,跟 sfcDescriptor 是一样的
* options 配置
* indents 缩进
* template: 2 // 默认
* script: 0 // 默认
* style: 0 // 默认
* @returns String 转换之后的 vue-sfc 内容
*/
const str = Stringify(sfcDescriptor, originSfcDescriptor, options);
```