Skip to content
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
41 changes: 21 additions & 20 deletions inspect-extension/components/composition/attributesCheck.mpx
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
<template>
<view>
<view class="page-section page-section-spacing swiper">
<icon />
<!-- ^ 缺少必填属性 `type` -->
<swiper
indicator-dots="{{ indicatorDots }}"
autoplay="{{ autoplay }}"
interval="{{ interval }}"
duration="{{ duration }}"
bindchange="{{ onSwiperChange }}"
>
<block wx:for="{{ backgroundList }}" wx:key="*this">
<swiper-item>
<view class="swiper-item">
{{ item }}
</view>
</swiper-item>
</block>
</swiper>
</view>
<view>
<view class="page-section page-section-spacing swiper">
<icon />
<button plain="{{ true }}" />
<!-- ^ 缺少必填属性 `type` -->
<swiper
indicator-dots="{{ indicatorDots }}"
autoplay="{{ autoplay }}"
interval="{{ interval }}"
duration="{{ duration }}"
bindchange="{{ onSwiperChange }}"
>
<block wx:for="{{ backgroundList }}" wx:key="*this">
<swiper-item>
<view class="swiper-item">
{{ item }}
</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
</template>

<script setup lang="ts">
Expand Down
63 changes: 17 additions & 46 deletions packages/language-service/src/data/sfcBlocks.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,18 @@
import type * as html from 'vscode-html-languageservice'
import { MpxDocs, WxDocs } from './utils'
import { MpxDocs, MpxGuideUrl } from './utils'

const data: html.HTMLDataV1 = {
version: 1.0,
tags: [
{
name: 'template',
attributes: [
{
name: 'src',
description: {
kind: 'markdown',
value:
'模板引用-定义\n\n在当前文件中定义了一个叫 `name` 的 `template`,比如:\n\n```html\n<template name="item">\n <text>{{text}}</text>\n</template>\n```\n\n',
},
references: [
{
name: WxDocs,
url: 'https://developers.weixin.qq.com/miniprogram/dev/reference/wxml/import.html',
},
],
},
{
name: 'is',
description: {
kind: 'markdown',
value:
'模板引用-使用\n\n在当前模板中引用了名为 `item` 的模板后就可以使用该模板,比如:\n\n```html\n<template is="item" data="{{text: \'forbar\'}}"/>\n```\n',
},
references: [
{
name: WxDocs,
url: 'https://developers.weixin.qq.com/miniprogram/dev/reference/wxml/import.html',
},
],
},
],
attributes: [],
description: {
kind: 'markdown',
value: '\n`<template>` 模板模块\n',
},
references: [
{ name: MpxDocs, url: 'https://mpxjs.cn/guide/basic/template.html' },
{ name: MpxDocs, url: `${MpxGuideUrl}/basic/template.html` },
],
},
{
Expand All @@ -57,7 +28,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/tool/ts.html#mpx%E4%B8%AD%E7%BC%96%E5%86%99ts-%E6%8E%A8%E8%8D%90',
url: `${MpxGuideUrl}/tool/ts.html#mpx%E4%B8%AD%E7%BC%96%E5%86%99ts-%E6%8E%A8%E8%8D%90`,
},
],
},
Expand All @@ -80,7 +51,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/tool/ts.html#mpx%E4%B8%AD%E7%BC%96%E5%86%99ts-%E6%8E%A8%E8%8D%90',
url: `${MpxGuideUrl}/tool/ts.html#mpx%E4%B8%AD%E7%BC%96%E5%86%99ts-%E6%8E%A8%E8%8D%90`,
},
],
},
Expand All @@ -95,7 +66,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/composition-api/composition-api.html#script-setup',
url: `${MpxGuideUrl}/composition-api/composition-api.html#script-setup`,
},
],
},
Expand All @@ -115,7 +86,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/basic/start.html#%E5%BC%80%E5%A7%8Bcode',
url: `${MpxGuideUrl}/basic/start.html#%E5%BC%80%E5%A7%8Bcode`,
},
],
},
Expand All @@ -135,7 +106,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/basic/start.html#%E5%BC%80%E5%A7%8Bcode',
url: `${MpxGuideUrl}/basic/start.html#%E5%BC%80%E5%A7%8Bcode`,
},
],
},
Expand All @@ -148,7 +119,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/basic/start.html#%E5%BC%80%E5%A7%8Bcode',
url: `${MpxGuideUrl}/basic/start.html#%E5%BC%80%E5%A7%8Bcode`,
},
],
},
Expand All @@ -163,7 +134,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/composition-api/composition-api.html#script-setup',
url: `${MpxGuideUrl}/composition-api/composition-api.html#script-setup`,
},
],
},
Expand All @@ -180,7 +151,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/basic/css.html#style-src-%E5%A4%8D%E7%94%A8',
url: `${MpxGuideUrl}/basic/css.html#style-src-%E5%A4%8D%E7%94%A8`,
},
],
},
Expand Down Expand Up @@ -215,7 +186,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/basic/css.html#css-%E9%A2%84%E7%BC%96%E8%AF%91',
url: `${MpxGuideUrl}/basic/css.html#css-%E9%A2%84%E7%BC%96%E8%AF%91`,
},
],
},
Expand All @@ -230,7 +201,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/basic/css.html',
url: `${MpxGuideUrl}/basic/css.html`,
},
],
},
Expand All @@ -243,7 +214,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/basic/css.html',
url: `${MpxGuideUrl}/basic/css.html`,
},
],
},
Expand All @@ -256,7 +227,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/basic/css.html',
url: `${MpxGuideUrl}/basic/css.html`,
},
],
},
Expand All @@ -271,7 +242,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/basic/start.html#%E5%BC%80%E5%A7%8Bcode',
url: `${MpxGuideUrl}/basic/start.html#%E5%BC%80%E5%A7%8Bcode`,
},
],
},
Expand All @@ -286,7 +257,7 @@ const data: html.HTMLDataV1 = {
references: [
{
name: MpxDocs,
url: 'https://mpxjs.cn/guide/basic/start.html#%E5%BC%80%E5%A7%8Bcode',
url: `${MpxGuideUrl}/basic/start.html#%E5%BC%80%E5%A7%8Bcode`,
},
],
},
Expand Down
Loading