Skip to content

Commit 4feafcb

Browse files
committed
1. minor css fix for firefox and safari browser
2. added beforeDestroy to clean up 3. releasing 1.0.3
1 parent b04e56d commit 4feafcb

File tree

9 files changed

+28
-7
lines changed

9 files changed

+28
-7
lines changed

build/webpack.prod.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const webpackConfig = merge(baseWebpackConfig, {
2727
devtool: config.build.productionSourceMap ? config.build.devtool : false,
2828
output: {
2929
path: config.build.assetsRoot,
30+
publicPath: '',
3031
filename: utils.assetsPath('js/[name].js'),
3132
chunkFilename: utils.assetsPath('js/[id].js')
3233
},

dist/vue-numeric-input.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/js/app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/js/manifest.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/js/manifest.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-numeric-input",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Vue Numeric Input Component",
55
"author": "JayeshLab <helloiamjayesh@gmail.com>",
66
"license": "MIT",

src/vue-numeric-input.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ export default {
250250
blur () {
251251
this.$refs.input.blur()
252252
}
253+
},
254+
beforeDestroy () {
255+
clearInterval(this.interval)
256+
this.interval = null
257+
this.handler = null
258+
this.startTime = null
253259
}
254260
}
255261
</script>
@@ -259,6 +265,7 @@ export default {
259265
-webkit-appearance: none;
260266
margin: 0;
261267
}
268+
input[type=number] {-moz-appearance: textfield;}
262269
button:focus {
263270
outline: none;
264271
}
@@ -284,6 +291,7 @@ export default {
284291
.vue-numeric-input .btn {
285292
position: absolute;
286293
width: 1.5rem;
294+
margin: 0;
287295
cursor: default;
288296
text-align: center;
289297
transition: all 0.1s ease 0s;

test/unit/specs/vue-numeric-input.spec.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ describe('VueNumericInput.vue', () => {
200200
done()
201201
})
202202
})
203-
204203
it('align', () => {
205204
const vm = new Vue({
206205
template: '<vue-numeric-input v-model="value" align="center"></vue-numeric-input>',
@@ -295,6 +294,19 @@ describe('VueNumericInput.vue', () => {
295294
vm.$refs.numeric.blur()
296295
expect(input.blur).to.have.been.called
297296
})
297+
it('test beforeDestroy method', () => {
298+
const vm = new Vue({
299+
template: '<vue-numeric-input ref="numeric" v-model="value"></vue-numeric-input>',
300+
data () {
301+
return {
302+
value: 10
303+
}
304+
}
305+
}).$mount()
306+
sinon.spy(window, 'clearInterval')
307+
vm.$destroy()
308+
expect(window.clearInterval).to.have.been.called
309+
})
298310
it('emit focus', () => {
299311
const vm = new Vue({
300312
template: '<vue-numeric-input ref="numeric" v-model="value"></vue-numeric-input>',

0 commit comments

Comments
 (0)