Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Created January 27, 2018 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/c0585cc37000752c7e0ba3edf81da4f0 to your computer and use it in GitHub Desktop.
Save matthieu-D/c0585cc37000752c7e0ba3edf81da4f0 to your computer and use it in GitHub Desktop.
import CounterSingleton from './counter-singleton';
export default {
template : `<div>
<button @click="show">
Show
</button>
<button @click="add">
Add
</button>
</div>`,
data : function () {
return {
counterService: CounterSingleton.getInstance()
}
},
methods : {
show: function () {
this.counterService.show();
},
add: function () {
this.counterService.add();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment