Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue 2.7 support #79

Merged
merged 4 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/components/demos/events.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default

.event
display block
>>> strong
:deep(strong)
opacity 0.5

.name
Expand Down
2 changes: 1 addition & 1 deletion demo/components/slide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ img
p
margin-v 0

.contents >>> a
.contents :deep(a)
text-decoration underline

</style>
4 changes: 3 additions & 1 deletion demo/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ export default {

// Enable crawler to find dynamic pages
generate: {
crawler: true,
routes: () => ['/'],
},

// Cloak Boilerplate settings
cloak: {
boilerplate: {
siteName: 'vue-ssr-carousel demo',
excludedModules: [
'generate', // Excluded because it disables the crawler
],
},
},

Expand Down
6 changes: 3 additions & 3 deletions demo/pages/_page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ h2
style-h2()

// Syntax highlighting
>>> pre
:deep(pre)
background darken(primary-background, 15%)
border 1px solid darken(primary-background, 30%)
basic-border-radius()
fluid-space margin-bottom, 's'
>>> code
:deep(code)
font-size 14px
line-height 1.2

Expand All @@ -112,7 +112,7 @@ p
background darken(primary-background, 10%)

// Add constant margins around demos
>>> .ssr-carousel
:deep(.ssr-carousel)
fluid-space margin-v, 's'

// Clear the effect of the page gutters
Expand Down
10 changes: 7 additions & 3 deletions src/ssr-carousel-track.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default
# Return modified vnode
return vnode

# Get the list of non-text slides, including peeking clones. This doesn't
# Get the list of non-text slides, including peeking clones. This doesn't
# work as a computed function
getSlideComponents: ->
[...(@$slots.default || []), ...(@$slots.clones || [])]
Expand All @@ -96,16 +96,20 @@ export default
# https://github.com/vuejs/vue/issues/6052#issuecomment-313705168
makeReactiveVnode: (vnode) ->

# Expect a data object. When it doesn't exist, it's a sign this this
# vnode can't be manipulated vue-ssr-carousel.
console.error "vnode has no data", vnode unless vnode.data

# Make the new vnode and data
newVnode = { ...vnode }
newVnode.data = { ...vnode.data }

# Clone style property. String styles will be on staticStyle so we can
# ignore them.
newVnode.data.style = { ...vnode.data?.style }
newVnode.data.style = { ...vnode.data.style }

# Clone attrs property
newVnode.data.attrs = { ...vnode.data?.attrs }
newVnode.data.attrs = { ...vnode.data.attrs }

# Return the clone
return newVnode
Expand Down
Loading