vitejs / vite-plugin-vue2

Vite plugin for Vue 2.7
MIT License
551 stars 47 forks source link

slot doesn't work #39

Closed ZengTianShengZ closed 2 years ago

ZengTianShengZ commented 2 years ago

my component

// Button.vue
<template>
    <button class="gd-btn">
        <slot>submit</slot>
    </button>
</template>

<style>
.gd-btn{
    width: 80px;
    height: 30px;
    border: 1px solid red;
    background: #fff;
}
</style>

use my component

<div>
   <Button/>
</div>

component does not render default slot content

image

version:

  "vue": "2.7.8"
  "@vitejs/plugin-vue2": "^1.1.2",
  "vite": "^3.0.2",

   node: v16.15.1
   chrome: 103.0.5060.114
haoqunjiang commented 2 years ago

Can't reproduce.

If the issue still exists, please open a new issue with a minimal reproduction using a GitHub repository or StackBlitz

ZengTianShengZ commented 2 years ago

Sorry, the problem is caused by the version.

my vue version is 2.6.10

patak-dev commented 2 years ago

@ZengTianShengZ vite-plugin-vue2 requires Vue 2.7+