碧血红天的HomePage

微信小程序 — 认识工程结构

通过微信开发者工具创建的工程,会附带一些基础代码和工程结构,我们首先要了解和认识这些结构。这样才方便我们后面开发得心应手,知道我们需要什么东西在什么地方修改和创建。

上图为新创建的一个工程,其中res是我自己创建的文件夹,components是我这创建出来用于存放开发的组件。pages 和 utils 是默认创建出的文件夹。

pages 是存放一个一个的界面的,utils 目前里面基本上没有什么代码,如果我们想自己写一些通用的工具函数可以放在其中。

app.*这几个文件是整个APP的相关的一些设置,比如app.wxss可以设置一些全局能够使用的样式效果,比如page的颜色等等。app.js会设置app的title,tabbar,导航栏颜色等等。

所以,我们前端逻辑的重心就是扩展Page和Component下面的内容,我这边全部以Component的方式实现各个组件,在后在Page中直接组合。这样我们保证每个page的视图内容比较简单干净。

41 评论

  1. Attractive element of content. I just stumbled upon your blog and in accession capital to claim that I acquire in fact enjoyed account your blog posts.

    Anyway I’ll be subscribing for your augment or even I fulfillment you get admission to
    constantly quickly.

  2. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.
    You clearly know what youre talking about, why throw away
    your intelligence on just posting videos to your site when you could be giving
    us something informative to read?

  3. Hey there! I just would like to offer you a big thumbs up for your excellent info you have got right here on this
    post. I will be coming back to your website for more soon.

  4. Hello there! Do you use Twitter? I’d like to follow you if that would
    be okay. I’m absolutely enjoying your blog and look forward
    to new posts.

  5. Hello this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with
    HTML. I’m starting a blog soon but have no coding expertise so I wanted to get advice from someone with experience.
    Any help would be enormously appreciated!

  6. Greetings I am so grateful I found your weblog,
    I really found you by accident, while I was searching on Google
    for something else, Regardless I am here now and would just like to say thank you
    for a remarkable post and a all round thrilling blog (I also love the theme/design), I don’t have time
    to go through it all at the minute but I have
    bookmarked it and also added in your RSS feeds, so when I
    have time I will be back to read a lot more, Please
    do keep up the fantastic work.

  7. This site was… how do you say it? Relevant!! Finally I’ve found something that helped me.
    Thanks!

  8. Good way of telling, and pleasant post to obtain data
    concerning my presentation subject, which i am going to convey in academy.

  9. yes,ダッチワイフ と はbut also the debilitating inescapability of violence she faces as a woman in the U.

  10. For latest information you have to pay a visit the web and on world-wide-web I found this
    website as a most excellent web page for latest updates.

  11. As a result,ラブドール 動画many people of color find themselves remaining silent or policing their own emotions – often resulting in internalized feelings like anger,

  12. We’re a group of volunteers and opening a new scheme in our community.
    Your website offered us with valuable info to work on.
    You’ve done a formidable job and our whole community will be grateful to you.

  13. Like cell phone signals,those signals could go far.ラブドール

  14. e can be overly critical when we are afraid to trust our own judgment in romantic relationships.this is a result of being traumatized by previous relationships or having experienced someone close to us trapped in a bad romance.ラブドール エロ

  15. Heya i am for the first time here. I came across this board and I find It really useful & it helped me out much.
    I hope to give something back and help others like you helped me.

  16. I have read so many articles or reviews on the topic of the
    blogger lovers except this post is truly a nice article, keep it up.

  17. Hi there would you mind letting me know which web host you’re using?

    I’ve loaded your blog in 3 different web browsers and I must say this blog loads a lot quicker then most.
    Can you recommend a good web hosting provider at a reasonable price?
    Thanks, I appreciate it!

  18. Good post. I learn something new and challenging on websites I stumbleupon every day.
    It will always be helpful to read content from other authors and practice something from other websites.

    Stop by my site – หลักสูตรดำน้ำ

  19. Hey There. I found your weblog using msn. That is an extremely well written article.
    I’ll be sure to bookmark it and return to read extra of your helpful information.
    Thanks for the post. I will definitely return.

  20. You have made some good points there. I looked on the web to find out more about the issue and found most people will go along with your views on this website.

  21. You really make it appear really easy together
    with your presentation but I find this matter to be actually something that I feel
    I might never understand. It kind of feels too complex and very large for me.

    I am having a look forward in your next post,
    I will attempt to get the hold of it!

  22. I know this if off topic but I’m looking into starting my own blog and was curious what all is needed to get setup?
    I’m assuming having a blog like yours would cost a pretty
    penny? I’m not very internet savvy so I’m not 100% certain. Any
    tips or advice would be greatly appreciated. Kudos

  23. So how often are most couples having sex? And what does that mean for our relationship quality and satisfaction?The Most Common ResponseBefore addressing the different frequencies of sexual activity,and what that means for our relationship and sexual satisfaction,人形 えろ

  24. Велозапчасти и ремонт в Москве velosiped-magazin.ru

    Что касается купить взрослый велосипед Вы пришли по верному адресу. Наш веб магазин является представителем знаменитых брендов, которые делают лучшие модели великов. После приобретения работает гарантия и предлагается платное хранение велосипедов в Москве на зиму.

  25. ダッチワイフ と はthe film gives the viewer insight into the difference between strictly narcissistic characters and psychopathic characters.A narcissistic character,

  26. the more aggressive the attack.Individuals who are doing the right thing by reporting criminal acts,ラブドール 中古

  27. including Confederate soldiers who’ve been spotted in an upstairs window and a young girl who’s supposedly been seen in a hallway decked in a white dress.セクシー ランジェリー“Whether it’s actually haunted or not,

  28. some sons believe whether accurately or not that their mother loves them more than her husband.Instead of surrendering defeat,ラブドール エロ

  29. I got this site from my pal who informed me about this web site
    and now this time I am browsing this web site and reading very informative articles
    here.

  30. I was recommended this blog by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my trouble.

    You’re amazing! Thanks!

  31. Remarkable! Its truly amazing piece of writing, I have got much
    clear idea concerning from this piece of writing.

  32. Hi, Neat post. There is a problem with your site in internet explorer, would test this?

    IE still is the market leader and a big component of
    folks will pass over your wonderful writing due to this problem.

  33. A motivating discussion is worth comment. There’s no doubt that that you need to write more on this subject
    matter, it might not be a taboo matter but usually people do not discuss
    these topics. To the next! Cheers!!

  34. Excellent article. Keep posting such kind of info on your page.
    Im really impressed by it.
    Hello there, You’ve performed a great job. I will certainly digg
    it and personally recommend to my friends. I’m sure they’ll be benefited
    from this website.

  35. This is the right blog for anyone who really wants to find out about this topic.
    You know so much its almost tough to argue with you (not that
    I actually will need to…HaHa). You certainly put a fresh
    spin on a topic that’s been discussed for a long time.
    Excellent stuff, just wonderful!

  36. Hi just wanted to give you a brief heads up and let you know a few of the
    images aren’t loading correctly. I’m not sure why but I think its a linking
    issue. I’ve tried it in two different browsers and both show
    the same outcome.

  37. Now I am ready to do my breakfast, when having my breakfast coming
    again to read additional news.

  38. Having read this I believed it was rather enlightening.
    I appreciate you taking the time and effort to put this informative
    article together. I once again find myself spending way
    too much time both reading and commenting. But so what, it was still worth it!

发表评论