Comments (8)
Nice catch
from vue-social-sharing.
I noticed one other "caveat" when using inline-templates. The "scope" of anything in the inline-template is that of the parent (the component with the inline-template
prop). If one needs to reference a computed property from their own component (in my case calculating a set of classes), one needs to reference $parent
:
<template>
<div>
<social-sharing ... inline-template>
<network network="facebook" :class="$parent.myClasses">Facebook</network>
<network network="twitter" :class="$parent.myClasses">Twitter</network>
</social-sharing>
</div>
</template>
<script>
export default {
computed: {
myClasses() {
return ['btn', 'btn-primary']
}
}
}
</script>
Might be worth noting in the documentation. (the Vue.js documentation is not overly clear on the scope of inline-template
https://vuejs.org/v2/guide/components.html#Inline-Templates)
from vue-social-sharing.
You may want to consider using this library to handle merging of the context.data in functional components:
https://github.com/alexsasharegan/vue-functional-data-merge
We use this extensively in our functional components
from vue-social-sharing.
Thank you for the PR, the change has been tagged in https://github.com/nicolasbeauvais/vue-social-sharing/releases/tag/v2.2.9
The vue-functional-data-merge
library could indeed be a nice addition to vue-social-sharing
from vue-social-sharing.
Yeah vue-functional-data-merge
works quite well when merging context.data with additional attributes, etc.
We use it a lot in our functional components for Bootstrap-Vue (it was written by one of our members)
from vue-social-sharing.
Hmmm, I just upgraded to 2.2.9 and v-bound classes are still not working. only classes specified as a static string.
from vue-social-sharing.
These lines: https://github.com/nicolasbeauvais/vue-social-sharing/blob/master/src/social-sharing-network.js#L16-L18
Do not appear in the dist files:
https://github.com/nicolasbeauvais/vue-social-sharing/blob/master/dist/vue-social-sharing.js#L58-L61
It doesn't appear that the dist
files were updated
from vue-social-sharing.
BTW... all is working great now... except one can't pass a title
prop (or other arbitrary attributes).
Object.assign((), context.data.attrs, {.. custom data attrs here })
would work well for merging attributes, except for IE, which needs a polyfill for Object.assign
:(
from vue-social-sharing.
Related Issues (20)
- Lighthouse - Links are not crawlable HOT 5
- Email sharing in Safari and Firefox opens a blank tab HOT 1
- Nuxt 3 - serialize is not defined HOT 7
- Messenger isn't working HOT 4
- Used in nuxt, the property “popup“” setting width and height are invalid
- Share to instagram HOT 1
- vue3 error ‘’Network fakeblock does not exist‘’ HOT 3
- How to add socials such as Tiktok, Twitch.tv using this library? HOT 1
- Pinterest Share Button Can't Work After Closing the Tab Open (Mobile Safari) HOT 1
- Nuxt3 nuxt.config.ts module error HOT 11
- Issue Uncaught DOMException: Permission denied to access property "__v_isRef" on cross-origin object HOT 7
- LinkedIn share on mobile opens the App but doesnt share content HOT 1
- Cannot restart nuxt: Cannot read properties of undefined (reading 'Index') HOT 8
- SMS share problem : Android13 device can not use sms share. the body message get lost HOT 1
- Can you please add Medium network? HOT 1
- Cannot read properties of undefined (reading 'Index') HOT 8
- Types diverge from the code HOT 1
- share by line, not the "url" I defined but to the domain HOT 1
- Range Issue, When I am using min and max value dynamically it is giving different values as I take slider from min and bring it back to the min end. It was 23000 but now it is showing 20000 05 61000 HOT 1
- When click share via LINE, there are errors keep appearing until popup closed HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-social-sharing.