Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "vue-nl2br", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A vue component that turns new lines into line breaks", | ||
"main": "index.js", | ||
"main": "./dist/vue-nl2br.js", | ||
"scripts": { | ||
"test": "echo \\\"Error: no test specified\\\" && exit 1" | ||
"test": "echo \\\"Error: no test specified\\\" && exit 1", | ||
"build": "webpack" | ||
}, | ||
@@ -14,3 +15,3 @@ "repository": { | ||
"keywords": [ | ||
"vue" | ||
"vue", "nl2br" | ||
], | ||
@@ -22,3 +23,11 @@ "author": "INOUE Takuya", | ||
}, | ||
"homepage": "https://github.com/inouetakuya/vue-nl2br#readme" | ||
"homepage": "https://github.com/inouetakuya/vue-nl2br#readme", | ||
"dependencies": { | ||
"vue": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.24.1", | ||
"babel-loader": "^7.0.0", | ||
"webpack": "^2.6.1" | ||
} | ||
} |
# vue-nl2br | ||
A vue component that turns new lines into line breaks | ||
A vue component that turns new lines into line breaks. | ||
## Requirement | ||
* [Vue.js](https://github.com/vuejs/vue) `^2.0.0` | ||
## Install | ||
```sh | ||
npm install --save vue-nl2br | ||
``` | ||
## Usage | ||
```html | ||
<nl2br tag="p" :content="`myLine1\nmyLine2`" /> | ||
``` | ||
is rendered to | ||
```html | ||
<p>myLine1<br>myLine2</p> | ||
``` | ||
### (1) To register a global component | ||
https://vuejs.org/v2/guide/components.html#Registration | ||
```js | ||
import Vue from 'vue' | ||
import Nl2br from 'vue-nl2br' | ||
Vue.component('nl2br', Nl2br) | ||
``` | ||
### (2) Local registration | ||
https://vuejs.org/v2/guide/components.html#Local-Registration | ||
```vue | ||
// MyComponent.vue | ||
<template> | ||
<nl2br tag="p" :content="`myLine1\nmyLine2`" /> | ||
</template> | ||
<script> | ||
import Nl2br from 'vue-nl2br' | ||
export default { | ||
name: 'my-component', | ||
components: { | ||
Nl2br, | ||
}, | ||
// ... | ||
} | ||
</script> | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
100801
15
155
61
0
1
3
+ Addedvue@^2.0.0
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/parser@7.26.3(transitive)
+ Added@babel/types@7.26.3(transitive)
+ Added@vue/compiler-sfc@2.7.16(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addednanoid@3.3.8(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@8.4.49(transitive)
+ Addedprettier@2.8.8(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsource-map-js@1.2.1(transitive)
+ Addedvue@2.7.16(transitive)