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

feat: add binding for external data #2296

Merged
merged 1 commit into from Sep 26, 2023

Conversation

maximepvrt
Copy link
Contributor

@maximepvrt maximepvrt commented Sep 7, 2023

External variables binding for #2053

I've implemented a feature that allows for external variable binding within the Nuxt Content. This enhancement enables seamless integration of external variables into the project, thereby enhancing its functionality and flexibility.

I remain enthusiastic about contributing to the Nuxt Content project and ensuring its continued growth and improvement.

<template>
  <div>
    <ContentRendererMarkdown :value="data" :data="mdcVars"/>
    <button type="button" v-on:click="mdcVars.name = 'Hugo'">Change name</button>
  </div>
</template>

<script setup lang="ts">
const { data } = await useAsyncData(() => queryContent('test').findOne());
const mdcVars = ref({ name: 'Maxime'});
</script>

test.md

# Hello {{ $doc.name }}

@netlify
Copy link

netlify bot commented Sep 7, 2023

Deploy Preview for nuxt-content canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 5fa03cb
🔍 Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/64f9e5fecaf7760008331f7f

@maximepvrt
Copy link
Contributor Author

local pnpm test is ok

Test Files 10 passed (10)
Tests 394 passed (394)
Start at 17:14:29
Duration 43.15s (transform 592ms, setup 0ms, collect 3.21s, tests 227.62s, environment 1ms, prepare 924ms)

@maximepvrt
Copy link
Contributor Author

🙏 @farnabaz

Copy link
Member

@farnabaz farnabaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ❤️

@farnabaz farnabaz merged commit 4b9b954 into nuxt:main Sep 26, 2023
7 checks passed
@farnabaz farnabaz mentioned this pull request Sep 26, 2023
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.

None yet

2 participants