创新互联百度小程序教程:swan.setMetaDescription

  • swan.setMetaDescription
    • 方法参数
      • object 参数说明
    • 示例
      • 图片示例
      • 代码示例

    swan.setMetaDescription

    不推荐使用。

    解释: 设置 web 版小程序 description meta 信息。此方法为 web 版小程序专用方法,使用前需判断方法是否存在。

    方法参数

    Object object

    object 参数说明

    属性名 类型 必填 默认值 说明
    content String 需要设置的 description 内容
    success Function 接口调用成功的回调函数
    fail Function 接口调用失败的回调函数
    complete Function 接口调用结束的回调函数(调用成功、失败都会执行)

    示例

    在开发者工具中打开

    在开发者工具中打开

    在 WEB IDE 中打开

    请在开发者工具中,单击“预览”,输入您的 AppID,单击“ WEB 预览”,百度 App 中扫码体验。

    图片示例

    代码示例

    • SWAN
    • JS
     
     
     
     
     
     
    1. Page({
    2. setMetaDescription() {
    3. swan.setMetaDescription({
    4. content: '小程序 description meta 信息',
    5. success: res => {
    6. console.log('setMetaDescription success', res);
    7. },
    8. fail: err => {
    9. console.log('setMetaDescription fail', err);
    10. }
    11. });
    12. }
    13. });

    新闻名称:创新互联百度小程序教程:swan.setMetaDescription
    转载注明:http://www.kmzsk.com/article/dpsgecj.html

    其他资讯

    Copyright © 2026 昆明姝彩聂商贸有限公司 All Rights Reserved 滇ICP备2025072963号-9
    友情链接: 企业网站建设公司 网站制作公司 重庆电商网站建设 手机网站制作 网站制作 四川成都网站建设 网站建设开发 重庆企业网站建设 品牌网站建设 梓潼网站设计 成都响应式网站建设 移动网站建设 定制网站设计 响应式网站建设 营销网站建设 宜宾网站设计 成都网站建设 营销型网站建设 成都营销网站制作 教育网站设计方案 古蔺网站建设 网站建设公司