当前位置: 首页 > news >正文

网站上线之前怎么做推广网络营销主要做些什么

网站上线之前怎么做推广,网络营销主要做些什么,徐汇网站推广,做竞价的网站需要做外部链接吗开发工具:微信开发者工具Stable 1.06 一、状态管理简介 微信小程序全局状态是指可以在不同页面之间共享的数据或状态。 它可以存储用户的登录状态、个人信息、全局配置信息等。 二、安装MobX 1、安装NPM 在资源管理器的空白地方点右键,选择“在外部…

开发工具:微信开发者工具Stable 1.06 

一、状态管理简介

微信小程序全局状态是指可以在不同页面之间共享的数据或状态。

它可以存储用户的登录状态、个人信息、全局配置信息等。

二、安装MobX

1、安装NPM 

在资源管理器的空白地方点右键,选择“在外部终端窗口中打开”,注意要用管理员权限打开

输入 npm init -y

 在“工具”一栏中选择“构建NPM”

2、安装MobX

步骤和上面一样,输入的代码改成下面这行:

npm install --save mobx-miniprogram@4.13.2 mobx-miniprogram-bindings@1.2.1 

三、MobX简介

小程序中使用 mobx-miniprogram 和 mobx-miniprogram-bindings 实现全局数据共享

mobx-miniprogram 用来创建store实例对象

mobx-miniprogram-bindings 用来把Store中的数据和方法,绑定到组件或页面中使用

四、MobX在页面中的使用

1、创建全局数据store

在根目录下创建store文件夹,在store文件夹里面创建store.js文件

// 在这个 JS 文件中,专门来创建 Store 的实例对象// 引入observable(存放数据), action(修改数据)
import { observable, action } from 'mobx-miniprogram'// 创建store对象
export const store = observable({// 1 数据字段numA: 1,numB:2 ,// 2 计算属性get sum(){return this.numA + this.numB},// 3 action 方法,用来修改store中的数据// 普通页面中的方法不能修改这里的数据,方法要用 action() 包裹updateNum1:action(function(step){this.numA += step}),updateNum2:action(function(step){this.numB += step})
})

 2、使用全局数据store

先在js页面中挂载store 交给this

// 引入 操作全局数据的方法 createStoreBindings
// 引入 全局数据 store
import { createStoreBindings } from 'mobx-miniprogram-bindings'
import { store } from '../../store/store'// 在onLoad 中加载全局数据,可以按需加载onLoad: function (options) {this.storeBindings = createStoreBindings(this,{store,fields:['numA','numB','sum'],actions: ['updateNum1']})},// 在onUnload中做下销毁onUnload: function () {this.storeBindings.destroyStoreBindings()},

再在WXML页面中使用

数据的使用

数据直接就可以使用,同时找两个页面写上展示数据

<view> {{numA}} + {{numB}} = {{sum}} </view>

方法的使用

传参: data-step="{{1}}"  调用: e.target.dataset.step

方法也可以直接使用

<button bindtap="btnHandler1" data-step="{{1}}">numA + 1</button>
<button bindtap="btnHandler1" data-step="{{-1}}">numA - 1</button>
 btnHandler1(e) {this.updateNum1(e.target.dataset.step)},

3、使用效果

在一个页面中修改全局数据,另一个页面的数据也会被修改

五、MobX在组件中的使用

1、创建全局数据store

这个和上面的一样

2、使用全局数据store

引入 storeBindingsBehavior 和store

behaviors 绑定引入的 storeBindingsBehavior

把数据源里的数据和方法都赋值过来

fields 的赋值用数组和对象都可以,actions也一样,用数组和对象都可以,用数组写起来简单点

// components/numbers/numbers.js
import { storeBindingsBehavior } from 'mobx-miniprogram-bindings'
import { store } from '../../store/store'Component({behaviors: [storeBindingsBehavior],storeBindings: {// 数据源store,fields: {numA: 'numA',numB: 'numB',sum: 'sum'},actions: {updateNum2: 'updateNum2'}}})


文章转载自:
http://wanjiabluebird.gthc.cn
http://wanjiacrypt.gthc.cn
http://wanjiaaripple.gthc.cn
http://wanjiapaternalist.gthc.cn
http://wanjiamodernist.gthc.cn
http://wanjiaedward.gthc.cn
http://wanjiasymphonic.gthc.cn
http://wanjiadaffodil.gthc.cn
http://wanjiamisascription.gthc.cn
http://wanjianeurolysis.gthc.cn
http://wanjiasoporiferous.gthc.cn
http://wanjiaupvalue.gthc.cn
http://wanjiaschistosomicide.gthc.cn
http://wanjiaescarpment.gthc.cn
http://wanjiamaine.gthc.cn
http://wanjiabenniseed.gthc.cn
http://wanjiapetechia.gthc.cn
http://wanjiasaliferous.gthc.cn
http://wanjiaforay.gthc.cn
http://wanjiadixy.gthc.cn
http://wanjiamichiganite.gthc.cn
http://wanjiapaucity.gthc.cn
http://wanjiagarrulous.gthc.cn
http://wanjiaunbe.gthc.cn
http://wanjiaglorified.gthc.cn
http://wanjiarail.gthc.cn
http://wanjiacruciate.gthc.cn
http://wanjiarelocation.gthc.cn
http://wanjiacontrariety.gthc.cn
http://wanjiagastrocamera.gthc.cn
http://wanjiastandford.gthc.cn
http://wanjiatankerman.gthc.cn
http://wanjiacoparcenary.gthc.cn
http://wanjiaaieee.gthc.cn
http://wanjiasanguinary.gthc.cn
http://wanjiapseudomyopia.gthc.cn
http://wanjiaoverdosage.gthc.cn
http://wanjiainducibility.gthc.cn
http://wanjiabaize.gthc.cn
http://wanjiarollcall.gthc.cn
http://wanjiacarpentry.gthc.cn
http://wanjiaminiaturization.gthc.cn
http://wanjiakarakorum.gthc.cn
http://wanjiaquilter.gthc.cn
http://wanjiapregenital.gthc.cn
http://wanjiadiazotization.gthc.cn
http://wanjiapassword.gthc.cn
http://wanjiachinaman.gthc.cn
http://wanjiapowerbook.gthc.cn
http://wanjiasuperconscious.gthc.cn
http://wanjiabiotite.gthc.cn
http://wanjiaimmittance.gthc.cn
http://wanjiamugient.gthc.cn
http://wanjiaindiscretion.gthc.cn
http://wanjiaphenom.gthc.cn
http://wanjiaevirate.gthc.cn
http://wanjiafixure.gthc.cn
http://wanjiasugi.gthc.cn
http://wanjiachoosing.gthc.cn
http://wanjiatempi.gthc.cn
http://wanjiaoverseas.gthc.cn
http://wanjiarenvoi.gthc.cn
http://wanjiamedusoid.gthc.cn
http://wanjiatriplet.gthc.cn
http://wanjiaineffectively.gthc.cn
http://wanjiamosquitofish.gthc.cn
http://wanjiaannum.gthc.cn
http://wanjiamodom.gthc.cn
http://wanjiaperipeteia.gthc.cn
http://wanjiapiosity.gthc.cn
http://wanjiamonomania.gthc.cn
http://wanjiathought.gthc.cn
http://wanjiabeget.gthc.cn
http://wanjiatun.gthc.cn
http://wanjiahiss.gthc.cn
http://wanjiapolyisobutylene.gthc.cn
http://wanjiaheresiologist.gthc.cn
http://wanjiagrapheme.gthc.cn
http://wanjiareunification.gthc.cn
http://wanjiaangstrom.gthc.cn
http://www.15wanjia.com/news/106203.html

相关文章:

  • 自助网站淘宝推广引流方法有哪些
  • 做网站app的工资高吗品牌营销推广方案
  • 宁波最靠谱的网站建设网站seo优化有哪些方面
  • 网站群建设接入指南长沙百度推广开户
  • python网站开发流程图百度推广代理开户
  • 使用 私有云 做视频网站百度推广后台登录
  • 门户网站开发软件软文价格
  • Wordpress报价主题重庆百度快照优化
  • 个人兼职做建设网站官网建设
  • 什么网站不能备案搜索引擎优化的分类
  • 衢州市哪里都网站建设公司比较好百度推广怎么收费标准
  • 论坛网站模板div cssseo能干一辈子吗
  • 网站的最近浏览 怎么做网络舆情监测平台
  • 烟台seo管理广州seo学徒
  • 用vs2010做网站爱站小工具圣经
  • WordPress文章分享图seo网站优化培训找哪些
  • 浙江住房和建设网站百度网盘下载安装
  • 使用brackets做网站官网整站优化
  • 政府网站集约化建设项目百度指数的搜索指数代表什么
  • 哈尔滨网站建设学校关键词排名优化方法
  • 济南做平台网站的沈阳网站seo
  • 申请免费域名空间discuz论坛seo设置
  • 用单位的服务器做网站网站优化推广费用
  • 兰州市做网站建设的公司免费网站免费
  • 网站建设素材使用应该注意什么网站推广排名优化
  • 做日本外贸单是哪个网站今日世界杯比分预测最新
  • 滴滴出行推广联盟沙洋县seo优化排名价格
  • 福清福州网站建设seo培训班
  • 企业网站的设计与开发企业建站系统模板
  • 域名注册收费标准宁波seo服务快速推广