Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
fix(is): Vue doesn't like us using is so use _is
Browse files Browse the repository at this point in the history
  • Loading branch information
Cobertos committed Sep 19, 2020
1 parent 8b31788 commit bf236cd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Below is an example of the component in use in a Single File Component. After im
<template>
<input-contenteditable
v-model="myModel"
is="p"
_is="p"
:placeholder="myPlaceHolder"
:maxlength="25" />
</template>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"email": "[email protected]",
"url": "http://cobertos.com"
},
"version": "1.0.0",
"version": "1.0.1",
"repository": {
"type": "git",
"url": "https://github.com/Cobertos/vue-input-contenteditable"
Expand Down
4 changes: 2 additions & 2 deletions src/input-contenteditable.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<component
:is="is"
:is="_is"
contenteditable
:placeholder="placeholder"
@input='onInput'
Expand All @@ -16,7 +16,7 @@
export default {
name: 'input-contenteditable',
props: {
is: {
_is: {
type: String,
default: 'p'
},
Expand Down
4 changes: 4 additions & 0 deletions tests/dev/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
<div class="wrap">
ajsiod
<input-contenteditable v-model="test"
:_is="tag"
:placeholder="'asdasd'"
:maxlength="25"/>
<button
@click="tag='a'">Test</button>
</div>
</template>

Expand All @@ -16,6 +19,7 @@ export default {
},
data () {
return {
tag: 'p',
test: 'aaa'
};
}
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/input-contenteditable.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ describe('input-contenteditable.vue', () => {
//and there's no easy way to test that
});

describe('supports is', () => {
it('is default is p', () => {
describe('supports _is', () => {
it('_is default is p', () => {
//arrange/act
const wrapper = shallowMount(InputContenteditable);

//assert
expect(wrapper.element.tagName).to.equal('P');
});

it('is can also be passed in', () => {
it('_is can also be passed in', () => {
//arrange/act
const wrapper = shallowMount(InputContenteditable, {
propsData: {
is: 'a'
_is: 'a'
}
});

Expand Down

0 comments on commit bf236cd

Please sign in to comment.