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

fix: improve nuxt-content attrs handling #223

Merged
merged 2 commits into from
Jul 27, 2020
Merged

Conversation

benjamincanac
Copy link
Member

@benjamincanac benjamincanac commented Jul 3, 2020

Improve attrs handling on nuxt-content component so that you can pass class and id. Ensure to proxy these attributes to nuxt-content in dev mode with live editing.

Resolves #222, resolves #219.

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

nuxt-content component should be able to handle these use cases:

<nuxt-content :document="document" id="id-1" />
<nuxt-content :document="document" :id="`id-1`" />

<nuxt-content :document="document" class="class-1" />

<nuxt-content :document="document" :class="{ 'class-1': true }" />
<nuxt-content :document="document" :class="`class-1`" />
<nuxt-content :document="document" :class="['class-1']" />

<nuxt-content :document="document" class="class-1" :class="{ 'class-1': true }" />

@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2020

Codecov Report

Merging #223 into dev will increase coverage by 0.83%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #223      +/-   ##
==========================================
+ Coverage   89.56%   90.39%   +0.83%     
==========================================
  Files          15       15              
  Lines         527      552      +25     
  Branches      107      118      +11     
==========================================
+ Hits          472      499      +27     
+ Misses         48       47       -1     
+ Partials        7        6       -1     
Impacted Files Coverage Δ
lib/middleware.js 82.43% <0.00%> (-2.08%) ⬇️
lib/query-builder.js 96.90% <0.00%> (-1.91%) ⬇️
lib/utils.js 100.00% <0.00%> (ø)
lib/database.js 84.07% <0.00%> (+1.21%) ⬆️
lib/index.js 78.40% <0.00%> (+1.93%) ⬆️
lib/parsers/markdown/index.js 100.00% <0.00%> (+12.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5a11fc...543aa1a. Read the comment docs.

@benjamincanac benjamincanac marked this pull request as ready for review July 23, 2020 12:48
@benjamincanac benjamincanac merged commit 0e53340 into dev Jul 27, 2020
@benjamincanac benjamincanac deleted the fix/component-attrs branch July 27, 2020 08:20
benjamincanac added a commit that referenced this pull request Jul 27, 2020
* fix(lib): improve nuxt-content attrs handling

* test: check `nuxt-content` id and class generation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nuxt-content build error when class prop is an object nuxt-content live editing
3 participants