vue-selection-share
v1.3.10
Published
a medium-like text highlight sharing component with zero dependencies.
Downloads
7
Maintainers
Readme
vue-selection-share
a medium-like text highlight sharing component with zero dependencies.
to learn how I created this, click this to read a chinese tutorial.
well, it's all about reinventing the wheel.
🤤 usage
to install the single file component, run:
npm install --save vue-selection-share
to use the component:
import VueSelectionShare from 'vue-selection-share';
Vue.use(VueSelectionShare)
then add the component outside of the elements that needs the popover, and the clicking behaviours:
<VueSelectionShare @share="onShare" @highlight="onHighlight">
<p>mother of god</p>
</VueSelectionShare>
lastly add the methods
, to onShare
and onHighlight
:
methods: {
onShare (text) {
console.log('share:', text)
},
onHighlight (text) {
console.log('highlight:', text)
}
}