Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-nl2br

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-nl2br - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.idea/watcherTasks.xml

19

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc