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(client): add support for SFC in tabs view #775

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

FliPPeDround
Copy link

Hello

I'm currently working on implementing a plugin for Devtools, and I've noticed that the tab currently only supports static VNode. While this works fine for many use cases, I was wondering if it might be possible to provide more

To this end, I've created this PR as an initial attempt to introduce support for SFC. I would love to hear your thoughts on whether this feature aligns with the project's goals and if there are any considerations or improvements we should take into account. If you have any concerns or suggestions, please let me know – I'm more than happy to make adjustments based on your feedback.

Thank you very much for your time and consideration!

import { addCustomTab } from '@vue/devtools-kit'

addCustomTab({
  name: 'plugin_count',
  title: 'Plugin Count',
  icon: 'baseline-exposure-plus-1',
  view: {
    type: 'sfc',
    sfc: `
		<script setup lang="ts">
		import { ref } from 'vue'
		
		const count = ref(0)
		</script>
		
		<template>
		  <div class="h-full w-full flex flex-col items-center justify-center">
		    <div>
		      count is {{ count }}
		    </div>
		    <button class="btn" @click="count++">
		      increment
		    </button>
		  </div>
		</template>
		
		<style scoped>
		.btn {
		  background-color: #4c51bf;
		  color: #fff;
		  padding: 0.5rem 1rem;
		  border-radius: 0.25rem;
		  border: none;
		  cursor: pointer;
		}
		</style>
		`,
  },
  category: 'app',
})
image

Copy link

netlify bot commented Jan 18, 2025

Deploy Preview for vue-devtools-docs canceled.

Name Link
🔨 Latest commit 66522a0
🔍 Latest deploy log https://app.netlify.com/sites/vue-devtools-docs/deploys/678b29a3b5ae460008613b65

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.

1 participant