构建meteor应用程序

什么是流星? (What is Meteor?)

Meteor.js is an open-source platform built on Node and MongoDB. It's not just a framework, it's more than that.

Meteor.js是基于Node和MongoDB构建的开源平台。 它不仅是一个框架,而且还更多。

Is it comparable to Angular? Angular handles just the frontend parts of application. Meteor is more of a platform than Angular. It is both server and client-side code and handles a lot of the parts of applications that we need to create manually in Angular.

它可与Angular相媲美吗? Angular仅处理应用程序的前端部分。 流星比Angular更像一个平台。 它既是服务器端代码,又是客户端代码,它处理了我们需要在Angular中手动创建的应用程序的许多部分。

We'll be diving into a simple application in this tutorial to show off the benefits and power of Meteor.

在本教程中,我们将深入研究一个简单的应用程序,以展示Meteor的好处和功能。

meteor-homepage

重要须知 (Important Things to Know)

  • Real time built into its core: Meteor handles all of the real-time components so that as soon as you update something in your database, that change is made to all other connected users. Out of the box and very easy to use.

    实时内置在其核心中 :Meteor处理所有实时组件,因此,一旦您更新数据库中的某些内容,便会对所有其他连接的用户进行更改。 开箱即用,非常易于使用。
  • Full Stack Reactivity. In Meteor, realtime is the default. All layers, from database to template, update themselves automatically when necessary.

    全堆React性 。 在Meteor中,实时是默认设置。 从数据库到模板的所有层均在必要时自动更新。
  • Built-in build system Meteor believes that we spend too much time packaging our applications together and getting all the dependencies working together nicely. You don't have to fiddle with a Gulp configuration anymore. Meteor handles it all for you out of the box.

    内置的构建系统 Meteor认为,我们花费太多时间将应用程序打包在一起,并使所有依赖关系很好地协同工作。 您不必再花时间使用Gulp配置了。 流星开箱即用。
  • Great for single page apps and mobile

    非常适合单页应用程序和移动设备
  • Packages are handled through Meteor's pacakage management site: atmosphere.js (can also use npm and cordova packages)

    是通过流星的pacakage管理现场处理: atmosphere.js (也可以使用NPM和科尔多瓦包)
  • Connecting to external services and APIs is possible using ddp: DDP, the Distributed Data Protocol, is a simple protocol for fetching structured data from a server, and receiving live updates when that data changes. We won't deal with this in our application today, but it's good to know.

    使用ddp可以连接到外部服务和API:DDP(分布式数据协议)是一种简单的协议,用于从服务器获取结构化数据,并在数据更改时接收实时更新。 我们今天不会在我们的应用程序中处理此问题,但是很高兴知道。

我们将要建设的 (What We'll Be Building)

We'll be creating a very simple polling application where a user can:

我们将创建一个非常简单的轮询应用程序,用户可以在其中进行以下操作:

  • Create a poll with 3 choices

    创建具有3个选择的民意测验
  • Vote on polls

    投票表决
  • New polls and votes will show real-time

    新的民意调查和投票将显示实时

View the Demo

观看演示

Let's create our first Meteor app!

让我们创建第一个Meteor应用程序!

入门 (Getting Started)

安装流星 (Install Meteor)

  • download for windows: https://install.meteor.com/windows

    Windows版下载:https://install.meteor.com/windows
  • install for osx/linux: curl https://install.meteor.com/ | sh

    为osx / linux安装:curl https://install.meteor.com/ | SH

install-meteor-windows

  • test to make sure everything is installed (windows users only cmd)

    测试以确保已安装所有组件(仅Windows用户cmd)
meteor --version

meteor-version

演示应用 (Demo Apps)

Meteor comes with a few demo applications that you can try out. If you want to check out a few demo apps now, you can go into your command line and grab the demo application using:

流星附带了一些演示应用程序,您可以尝试。 如果您现在想签出一些演示应用程序,则可以进入命令行并使用以下方法获取演示应用程序:

// todo sample app
meteor create --example todos// example mobile application
meteor create --example localmarket

You can find the full list of examples in the Meteor GitHub.

您可以在Meteor GitHub中找到示例的完整列表。

Once you create a demo app, just cd into that project and run the application with:

一旦你创建了一个演示应用程序,只是cd转化项目并运行应用程序:

meteor

This will grab the necessary packages, bundle all the css and js, start your application using a Node server, and make it viewable in your browser.

这将获取必要的软件包捆绑所有css和js使用Node服务器启动应用程序 ,并使其在浏览器中可见。

http://localhost:3000

http://本地主机:3000

Here is the sample Todos application which is quite good looking:

这是示例Todos应用程序,看起来很不错:

meteor-demo-todos

Definitely click around the files in these demo applications and you'll see how Meteor apps tick. Let's move onto creating our own application now.

绝对单击这些演示应用程序中的文件,您将看到Meteor应用程序如何打勾。 现在让我们继续创建自己的应用程序。

创建一个新的应用程序 (Create a New Application)

With our newly installed Meteor CLI tools, we can easily create a new application with:

借助我们新安装的Meteor CLI工具,我们可以轻松创建具有以下内容的新应用程序:

meteor create polling

meteor-create-new-app

polling will be the name of our new application and it will be created in a new polling/ folder. This command will create 3 new files and a folder:

polling将是我们新应用程序的名称,它将在新的轮询/文件夹中创建。 此命令将创建3个新文件和一个文件夹:

| .meteor/              // holds information about our project
| polling.css       // the css for our project
| polling.html      // the overall template
| polling.js            // javascript for the client and server

This is a very barebones setup and will not be how we structure our application, but it is useful to see how a very simple application can be built.

这是一个非常准系统的设置,将不会是我们构建应用程序的方式,但是了解如何构建一个非常简单的应用程序会很有用。

You can run this app by cding into your new project and starting your meteor app with:

您可以运行这个程序通过cd ING到您的新项目,并开始与您的流星应用:

meteor

Then you can view it in the browser at http://localhost:3000

然后您可以在浏览器中的http:// localhost:3000上查看它

meteor-new-app-barebones

If you take a quick look into polling.js you'll see some JavaScript bindings to the Template (which is referencing our polling.html file). What you'll also find is two interesting lines of code that are how Meteor separates code that will be run on the server vs the client.

如果快速polling.js您会看到一些到Template JavaScript绑定(引用了我们的polling.html文件)。 您还会发现两条有趣的代码行,它们是Meteor分离将在服务器与客户端上运行的代码的方式。

if (Meteor.isClient) {// code here will only be run on the client
}if (Meteor.isServer) {// code here will only be run on the server
}

While we could build our whole application like this, with client and server code in the same file, I prefer to have our application structured so that we don't have to worry about where our client and server code is.

尽管我们可以这样构建整个应用程序,但客户端和服务器代码在同一个文件中,但我更喜欢对应用程序进行结构化,这样我们就不必担心客户端和服务器代码在哪里。

Keep that meteor command running for the duration of this tutorial. As we make changes to our application, Meteor will automatically restart the server, rebundle our files, and livereload our browser (while keeping all our data). Talk about convenient!

在本教程中,请继续运行该meteor命令。 当我们对应用程序进行更改时, Meteor将自动重新启动服务器,重新打包文件,并实时重新加载浏览器(同时保留所有数据) 。 讲方便!

流星推荐的应用程序结构 (Meteor Recommended Application Structure)

Luckily, Meteor has a few folders that are designed specifically for organizing our application. These folders are:

幸运的是,Meteor拥有一些专门用于组织我们的应用程序的文件夹。 这些文件夹是:

  • client/: The client folder is for files that will only be served to the client. Any CSS and JS files in this folder will be automatically bundled and sent to the browser.

    client / :客户端文件夹用于仅将文件提供给客户端的文件。 此文件夹中的所有CSS和JS文件都会自动捆绑并发送到浏览器。
  • server/: The folder for all your server side code. Store sensitive logic or data that a client shouldn't see.

    server / :所有服务器端代码的文件夹。 存储客户不应看到的敏感逻辑或数据。
  • public/: By default, Meteor will find the CSS and JS files in your project and bundle them together. Anything in this public folder will be not be bundled by Meteor and will be served directly to the client as-is. If you have an image at public/images/underwater-dogs.jpg, then you can reference that file from HTML using <img src="images/underwater-dogs.jpg">.

    public / :默认情况下,Meteor将在您的项目中找到CSS和JS文件并将它们捆绑在一起。 该公共文件夹中的任何内容都不会被Meteor捆绑,而是直接按原样提供给客户端。 如果您在public / images / underwater-dogs.jpg上有一张图片,则可以使用<img src="images/underwater-dogs.jpg">从HTML引用该文件。
  • private/: These files are only accessed by the server through the Assets API. We won't be dealing with this folder for this tutorial.

    private / :这些文件只能由服务器通过Assets API进行访问 。 在本教程中,我们将不处理此文件夹。

What's cool is that with this structure, we won't need to defined Meteor.isClient or Meteor.isServer anymore. If a file is in that folder, then Meteor knows which side of our application it belongs.

很棒的是,有了这种结构,我们不再需要定义Meteor.isClientMeteor.isServer 。 如果文件在该文件夹中,则Meteor知道它属于我们应用程序的哪一侧。

With these reserved folders in mind, let's look at how our application structure will look like:

考虑到这些保留的文件夹,让我们看一下我们的应用程序结构如何:

| .meteor
| client/                       // all the code for our client and browser|----- components/          // we'll be creating components for our application parts|--- poll-form.css|--- poll-form.html|--- poll-form.js|--- poll.css|--- poll.html|--- poll.js|----- app.body.html        // layout for our entire app|----- app.head.html        // document head for entire app|----- app.js                   // the overall js for our layout|----- app.css                   // the overall css for our layout
| collections/              // here we'll store our mongo models|----- polls.js         // defining our mongo collection
| server/                       // code for our server|----- bootstrap.js // adding sample data on app startup

client/ will be the folder where we spend most of our time. We'll go through all of the components, views, CSS/JS in the next section.

client /将是我们大部分时间的文件夹。 在下一节中,我们将介绍所有组件,视图,CSS / JS。

client/components/ will hold the different parts of our application. In this case, we just need a form to create polls and a component to show the individual polls. All JS and CSS files in the client folder will be bundled together by Meteor into our application so we're naming these files is done however we want. They'll all go to the same place anyway.

客户/组件/将保留我们应用程序的不同部分。 在这种情况下,我们只需要一个用于创建民意测验的表单和一个用于显示各个民意测验的组件。 客户文件夹中的所有JS和CSS文件都将被流星捆绑在一起到我们的应用程序中,因此我们可以根据需要命名这些文件。 无论如何,他们都会去同一个地方。

server/ will only contain one thing for now. We'll create a bootstrap.js file to seed our database with some sample data.

服务器/目前仅包含一件事。 我们将创建一个bootstrap.js文件,为我们的数据库添加一些示例数据。

collections/ is where we define Mongo collections. In this case, we'll only need one called polls.js.

collections /是我们定义Mongo集合的地方。 在这种情况下,我们只需要一个名为polls.js

routes.js will be in the root of our folder since the routes will be used in both the client and the server.

由于路由将同时在客户端和服务器中使用,所以route.js将位于我们文件夹的根目录中。

Take a look at the docs for more on Meteor file structure.

查看有关更多有关Meteor文件结构的文档。

We're going to start with the server and the collections part of our application first.

我们将从应用程序的服务器和集合部分开始。

定义Mongo集合 (Defining a Mongo Collection)

MongoDB is very simple to work with and we've gone over MongoDB in our article: An Introduction to Mongo. For our purpose for this application, we will be defining a single collection. Let's do that now.

MongoDB的使用非常简单,我们已经在文章: Mongo简介中介绍了MongoDB。 为了达到此应用程序的目的,我们将定义一个集合。 现在开始吧。

Create the collections/polls.js file and fill it with:

创建collections / polls.js文件,并填充以下内容:

Polls = new Mongo.Collection('polls');

Easy! The reason we define this in a collections/ folder and not in the client/ or the server/ folder is that this collection will be needed on both the server (creating sample polls) and client (creating new polls).

简单! 我们在collections /文件夹中而不是在client /server /文件夹中定义此原因的原因是,服务器(创建样本民意调查)和客户端(创建新民意调查)都需要此集合。

We are re-using code on the server and client and this is what makes Meteor such a breeze to work with. With the Mongo collection out of the way, let's create some sample data.

我们正在服务器和客户端上重用代码,这就是使Meteor轻而易举地使用的原因。 摆脱了Mongo的收集,让我们创建一些示例数据。

引导我们的应用程序和示例数据 (Bootstrapping Our Application and Sample Data)

Let's create some sample data for our application before we start to create the client-side part of our polling application. In the server/ folder, create a new file called bootstrap.js.

在开始创建轮询应用程序的客户端部分之前,让我们为应用程序创建一些示例数据。 在服务器/文件夹中,创建一个名为bootstrap.js的新文件。

Here is the full commented code for bootstrap.js:

这是bootstrap.js的完整注释代码:

// run this when the meteor app is started
Meteor.startup(function() {// if there are no polls available create sample dataif (Polls.find().count() === 0) {// create sample pollsvar samplePolls = [{question: 'Is Meteor awesome?',choices: [{ text: 'Of course!', votes: 0 },{ text: 'Eh', votes: 0 },{ text: 'No. I like plain JS', votes: 0 }]},{question: 'Is CSS3 Flexbox the greatest thing since array_slice(bread)?',choices: [{ text: '100% yes', votes: 0 },{ text: '200% yes', votes: 0 },{ text: '300% yes', votes: 0 }]}];// loop over each sample poll and insert into database_.each(samplePolls, function(poll) {Polls.insert(poll);});}});

We are using the Meteor.startup command to run this code when our server starts up. We're going to check if there are any polls already created in our database and create sample polls if there is nothing in the database.

服务器启动时,我们使用Meteor.startup命令运行此代码。 我们将检查数据库中是否已经创建了任何民意调查,如果数据库中没有任何内容,则创建样本民意调查。

Quick Note: If you ever want to clear what's in your database, just run meteor reset and your application will become a clear slate.

快速说明 :如果您想清除数据库中的内容,只需运行“ meteor reset ,您的应用程序就会变得清晰起来。

meteor-reset

从浏览器检查我们的数据库 (Checking Our Database from the Browser)

Since Meteor implements an instance of Mongo on the client, we are able to run MongoDB commands right in our browser's console. Meteor already restarted our application so that means it should've already ran that bootstrap.js file and created our sample polls.

由于Meteor 在客户端上实现了Mongo的实例,因此我们能够在浏览器的控制台中直接运行MongoDB命令。 Meteor已经重新启动了我们的应用程序,因此这意味着它应该已经运行了bootstrap.js文件并创建了示例民意调查。

Let's go into our browser and see our polls. Go into your browser's console and run the Mongo command to find all the Polls:

让我们进入浏览器,查看我们的民意调查。 进入浏览器的控制台并运行Mongo命令以查找所有Polls

Polls.find().fetch()

You'll see the two polls we created!

您会看到我们创建的两个民意调查!

meteor-browser-console-find

We now have the foundation we need to start building our polling application's frontend. We now have:

现在,我们有了开始构建轮询应用程序前端所需的基础。 我们现在有:

  • A solid Meteor file structure foundation

    坚实的Meteor文件结构基础
  • A Mongo collection to hold our polls

    Mongo收集来举行民意调查
  • Sample data in our database

    我们数据库中的样本数据

Let's move onto the thing that our users will actually see, the UI!

让我们继续我们的用户将实际看到的东西,UI!

前端基础和模板 (Frontend Foundation and Template)

  • app.body.html

    app.body.html
  • app.head.html

    app.head.html
  • app.js

    app.js

  • Meteor will find all references of <head> and <body> and combine whatever it finds to one <head> and <body>. So if you have multiple files that have a <body> or <head>, they will all be compiled into your final document.

    流星将找到<head><body>所有引用,并将找到的所有内容组合到一个<head><body> 。 因此,如果您有多个具有<body><head> ,它们都将被编译成最终文档。

Check the docs for more on Meteor templating.

检查文档以获取有关流星模板的更多信息。

Here is what our app.body.html and app.head.html files will consist of:

这是我们的app.body.htmlapp.head.html文件组成的内容:

client / app.body.html (client/app.body.html)

<body><!-- PULL IN THE POLL CREATION FORM --><div class="container"><div class="row"><div class="col-md-6 col-md-offset-3">{{ >pollForm }}</div></div></div>  <!-- LOOP OVER POLLS AND SHOW EACH --><div class="polls">{{ #each polls }}{{ >poll }}{{ /each }}</div></body>

{{ >pollForm }} will find a file with <template name="pollForm> within it. We will create this file next. The {{ >templateName }} syntax will be how we pull in different views from our application.

{{> pollForm}}将在其中找到一个带有<template name="pollForm>文件。我们接下来将创建此文件。 {{ >templateName }}语法将是我们从应用程序中提取不同视图的方式。

{{ #each polls }} will loop over the polls object and then show the template named poll. We'll look at how we pull in this polls object from our database soon.

{{#each polls}}将遍历polls对象,然后显示名为poll的模板。 我们将研究如何尽快从数据库中提取此polls对象。

client / app.head.html (client/app.head.html)

Here is the very simple <head> of our app. Meteor will inject all the requirements into this section.

这是我们应用程序的非常简单的 <head> 。 Meteor将把所有需求注入此部分。

<head><meta charset="utf-8"><title>My Polling App!</title><!-- CSS IS AUTOMATICALLY BUILT AND LOADED -->
</head>

投票模板 (Poll Templates)

Now that we have the main template down, let's create the two templates that we referenced: pollForm and poll.

现在我们有了主模板,让我们创建引用的两个模板: pollFormpoll

投票表(client / components / poll-form.html) (Poll Form (client/components/poll-form.html))

This will store the form for creating polls:

这将存储用于创建民意调查的表单:

<template name="pollForm"><form> <div class="form-group"><label>Question</label><input type="text" name="question" class="form-control" placeholder="Your Question"></div><div class="form-group"><label>Choice #1</label><input type="text" name="choice1" class="form-control" placeholder="Choice #1"></div><div class="form-group"><label>Choice #2</label><input type="text" name="choice2" class="form-control" placeholder="Choice #2"></div><div class="form-group"><label>Choice #3</label><input type="text" name="choice3" class="form-control" placeholder="Choice #3"></div><button type="submit" class="btn btn-lg btn-primary btn-block">Create Poll</button>
</form></template>

We'll just limit users to creating 3 options for now to keep things simple. In the future, you could add a plus button that adds an input for choices.

为了使事情变得简单,我们现在仅限制用户创建3个选项。 将来,您可以添加加号按钮,为选择项添加输入。

Here's some quick CSS to style the question group a little differently than the option inputs. We'll place this in poll-form.css.

这是一些快速CSS,其样式与选项输入略有不同。 我们将其放置在poll-form.css

.question-group   {margin-bottom:20px;background:#EEE;padding:20px;
}
.question-group label   {font-size:18px;
}

Let's go back to our browser and see what our cool application looks like now.

让我们回到浏览器,看看我们酷的应用程序现在看起来是什么样子。

poll-form

Pretty lackluster so far. This is because none of our Bootstrap classes will work because we never got Bootstrap CSS and added it to our project. We'll handle processing this form and then create our poll template. After that we'll move onto getting Bootstrap.

到目前为止还很乏味。 这是因为我们的Bootstrap类都不起作用,因为我们从未获得过Bootstrap CSS并将其添加到我们的项目中。 我们将处理此表单,然后创建我们的poll模板。 之后,我们将继续获取Bootstrap。

client / components / poll.html (client/components/poll.html)

This will be the poll template for showing off single polls.

这将是用于展示单个民意测验的poll模板。

<template name="poll"><div class="poll well well-lg" data-id="{{ _id }}"><h3>{{ question }}</h3>{{ #each indexedArray choices }}<a href="#" class="vote btn btn-primary btn-block" data-id="{{ _index }}"><span class="votes pull-right">{{ votes }}</span><span class="text">{{ text }}</span></a>{{ /each }}</div>
</template>

We will be displaying the question, choices, votes, and text associated with the poll.

我们将显示与民意调查相关的问题选择投票文本

How do we get these polls to show? In our original app.body.html file, we referenced the polls using {{ #each polls }}. We are also adding in data-id with the _index so that we'll be able to know which question to apply our vote to.

我们如何显示这些民意调查? 在我们原始的app.body.html文件中,我们使用{{ #each polls }}引用了民意{{ #each polls }} 。 我们还在_index添加了data-id ,以便我们能够知道将投票应用于哪个问题。

Let's give our body access to this object from our database now.

现在,让我们的身体从数据库中访问该对象。

We can easily assign variables to our body template by going into our app.js file and creating:

通过进入app.js文件并创建以下内容,我们可以轻松地将变量分配给我们的主体模板:

Template.body.helpers({polls: function() {return Polls.find();}});

Just like we used the Polls collection earlier, we can use it now to grab all our polls. This will give access to the polls object within our body template.

就像我们之前使用Polls集合一样,我们现在可以使用它来获取所有民意调查。 这将允许访问我们body模板中的polls对象。

Notice we also added an indexedArray to the choices each. This is because we don't inherently have the index when we loop over items in Meteor right now. That will probably change in the future, but it isn't implemented currently because of the reactive nature of the templating engine. Apparently $index in these real-time applications is a harder thing to pull off.

注意,我们还为每个choices添加了indexedArray 。 这是因为当我们现在在Meteor中循环浏览项目时,我们固有地没有索引。 这种情况将来可能会改变,但是由于模板引擎的React性,目前尚未实现。 在这些实时应用程序中,显然$ index很难实现。

We need to create this indexedArray helper so let's go back into app.js and add the following:

我们需要创建这个indexedArray帮助器,让我们回到app.js并添加以下内容:

// adds index to each item
UI.registerHelper('indexedArray', function(context, options) {if (context) {return context.map(function(item, index) {item._index = index;return item;});}
});

Thanks to Jenia Nemzer for the above helper. We now have access to the data-id={{ _index }}. We'll use this when we implement our voting features.

感谢Jenia Nemzer的上述帮助。 现在,我们可以访问data-id={{ _index }} 。 当我们实现投票功能时,将使用此功能。

Now we can see our polls that we created in our bootstrap.js file showing in our application.

现在,我们可以看到在bootstrap.js文件中创建的民意测验显示在应用程序中。

polls-showing

Let's wire up our form now to handle form submission.

让我们现在连接表单以处理表单提交。

处理投票表格 (Processing the Poll Form)

Meteor has a cool way of attaching events and variables to its templates. Currently, we have a pollForm template. Let's go into the poll-form.js file and add event handlers for our form submission.

流星有一种很酷的方式将事件和变量附加到其模板。 当前,我们有一个pollForm模板。 让我们进入poll-form.js文件并为表单提交添加事件处理程序。

client/components/poll-form.js

client/components/poll-form.js

Template.pollForm.events({// handle the form submission'submit form': function(event) {// stop the form from submittingevent.preventDefault();// get the data we need from the formvar newPoll = {question: event.target.question.value,choices: [{  text: event.target.choice1.value, votes: 0 },{  text: event.target.choice2.value, votes: 0 },{  text: event.target.choice3.value, votes: 0 }]};    // create the new pollPolls.insert(newPoll);}});

Template.pollForm.events is how we attach events to this specific template. We are defining an event to handle the submit form event.

Template.pollForm.events是我们将事件附加到此特定模板的方式。 我们正在定义一个事件来处理submit form事件。

We can pull data from the form inputs using event.target.{input_name}.value.

我们可以使用event.target。{input_name} .value从表单输入中提取数据。

After we have gotten all the data we need, we are going to insert the new poll into our database using Polls.insert() just like we did in our bootstrap.js file on the server-side of things. Go ahead and use your form to submit data and you'll find that the new poll automatically gets added to the list of polls.

在获得所需的所有数据之后,我们将使用Polls.insert()将新的民意调查插入到数据库中,就像在服务器端的bootstrap.js文件中所做的一样。 继续并使用表单提交数据,您会发现新的民意调查会自动添加到民意调查列表中。

添加投票功能 (Adding Voting Capabilities)

We've added polls to our overall template in app.js, handled processing the poll form in poll-form.js; now we will handle the last action, which is voting in the corresponding JS file, poll.js.

我们在app.js的整体模板中添加了polls并在poll-form.js处理了民意调查表单; 现在,我们将处理最后一个动作,即在相应的JS文件poll.js

Inside of client/components/poll.js, let's attach events to our template:

client/components/poll.js ,让我们将事件附加到模板中:

// attach events to our poll template
Template.poll.events({// event to handle clicking a choice'click .vote': function(event) {// prevent the default behaviorevent.preventDefault();// get the parent (poll) idvar pollID = $(event.currentTarget).parent('.poll').data('id');var voteID = $(event.currentTarget).data('id');// create the incrementing object so we can add to the corresponding votevar voteString = 'choices.' + voteID + '.votes';var action = {};action[voteString] = 1;// increment the number of votes for this choicePolls.update({ _id: pollID }, { $inc: action });}});

A fun thing we can do to traverse the DOM is to use jQuery to call the current event and then find exactly what we need. To update the vote number for what was just clicked, we will need to get the parent ID of the poll and then the index of what was just clicked.

我们可以遍历DOM的一个有趣的事情是使用jQuery调用当前事件,然后准确地找到我们需要的东西。 要更新刚刚单击的内容的投票号,我们需要获取民意调查的父ID,然后获取刚刚单击的内容的索引。

We will be using MongoDB's $inc operator to add 1 to the vote. Go ahead and click through your application and vote, and you'll see the votes increment.

我们将使用MongoDB的$ inc运算符在表决中加上1。 继续并单击您的应用程序并投票,您将看到投票数增加。

You may also be able to see other users voting in real time!

您还可以实时查看其他用户的投票!

This is some very simple templating here with the built in Meteor features. For future larger projects, we'll probably want to look at a routing solution like iron:router, currently the most popular Meteor package in Atmosphere, Meteor's packages site.

这是内置流星功能的一些非常简单的模板。 对于将来的大型项目,我们可能需要考虑一个路由解决方案,例如iron:router ,这是Meteor的软件包站点Atmosphere中目前最受欢迎的Meteor软件包。

使用来自大气层的流星包裹 (Using Meteor Packages from Atmosphere)

Let's install Bootstrap to get some quick styling for our application. The thing to know about Meteor packages is that you only need to install them to get them to work.

让我们安装Bootstrap以获得我们应用程序的一些快速样式。 关于Meteor软件包的了解是,您只需安装它们即可使它们工作。

Traditionally, to get Bootstrap, you would:

传统上,要获得Bootstrap,您将:

  • Download Bootstrap

    下载Bootstrap
  • Move Bootstrap into your project folders

    将Bootstrap移至项目文件夹
  • Add Bootstrap using a <link> tag in your project's <head>

    在项目的<head>使用<link>标记添加Bootstrap
  • Start using Bootstrap

    开始使用Bootstrap

In Meteor, all you have to do is install Bootstrap and it's automatically applied to your project. Meteor's build system will include the CSS on its own.

在Meteor中,您所要做的就是安装Bootstrap,它会自动应用于您的项目 。 流星的构建系统将单独包含CSS。

Let's install Bootstrap found in Atmosphere.

让我们安装Atmosphere中的Bootstrap。

meteor add twbs:bootstrap

meteor-add-bootstrap

Now, if we go look at our application, we'll see that our styling is there!

现在,如果我们看一下我们的应用程序,就会发现我们的样式在那里!

bootstrap-styled

Note: You could also do things the old fashioned way of grabbing the Bootstrap file and adding it to your public/ folder and then linking to it in the document <head> if you want to go that route.

注意:您也可以采用老式的方式来处理Bootstrap文件,并将其添加到public /文件夹,然后在文档<head>链接到该文件<head>如果要执行此操作)。

更简单CSS (A Little More Simple CSS)

In addition to having Bootstrap, let's add some of our own styles real quick to app.css to get our grid of polls looking a bit better:

除了使用Bootstrap之外,我们还可以快速向app.css添加一些自己的样式,以使民意调查表看起来更好一些:

Let's make our polls use flexbox to make it easier to create a grid of polls.

让我们使民意调查使用flexbox使其更容易创建民意调查网格。

Inside of app.css, let's add some quick styling:

app.css内部,让我们添加一些快速样式:

body  {padding-top:50px; 
}
.polls  {display:flex;flex-flow:row wrap;justify-content:center;
}
.poll   {width:25%;margin:20px;
}

We now have a decent looking application with the basic functionality of a polling application!

现在,我们有了一个外观不错的应用程序,它具有轮询应用程序的基本功能!

bootstrap-custom-styled

生产说明 (Notes for Production)

自动发布 (autopublish)

Since our application is still in development mode, all collections are automatically published from our server and subscribed to on our client. We probably won't want this behavior in our production applications since it doesn't make sense for users of our application to subscribe to EVERY part of our application, even the parts they aren't using at any one time.

由于我们的应用程序仍处于开发模式,因此所有集合都将从我们的服务器自动发布并在我们的客户端上订阅。 我们可能不希望在生产应用程序中出现这种行为,因为对于我们的应用程序用户而言,预订应用程序的每个部分,甚至是他们一次不使用的部分,都没有意义。

It makes more sense to only have a user subscribed to the data that they are seeing at any one time. If you go look into .meteor/packages to see the packages in your Meteor application, you'll see one called autopublish. This will need to be removed and then you'll have to publish and subscribe to data manually in your application.

只让用户订阅他们在任何时候看到的数据更有意义。 如果您查看.meteor / packages来查看Meteor应用程序中的软件包,则会看到一个名为autopublish 。 这将需要删除,然后您必须在应用程序中手动发布和订阅数据。

To remove this package, use:

要删除此软件包,请使用:

meteor remove autopublish

Then you can use Meteor.publish() and Meteor.subscribe().

然后,您可以使用Meteor.publish()和Meteor.subscribe() 。

部署中 (Deploying)

Now we want the whole world to see our super cool new application. We can use Meteor's servers to show off our application.

现在,我们希望全世界看到我们的超酷新应用程序。 我们可以使用Meteor的服务器来展示我们的应用程序。

With one simple command, our entire app will be available online:

通过一个简单的命令,我们的整个应用程序将可以在线使用:

meteor deploy scotch.meteor.com

You can change out the subdomain for anything you like as long as it isn't already taken. We'll explore deploying to your own servers in future articles.

您可以根据需要更改子域,只要它还没有被使用即可。 在以后的文章中,我们将探讨如何部署到您自己的服务器。

结论 (Conclusion)

Meteor provides so many great tools to easily and quickly prototype your applications. Real-time, JavaScript client and server-side, the packages system, build system, minimongo, and so much more.

Meteor提供了许多出色的工具,可轻松快速地对应用程序进行原型制作。 实时,JavaScript客户端和服务器端,软件包系统,构建系统,minimongo等。

Hopefully this has given you a good taste of how quickly you can build an application in Meteor.

希望这使您对在Meteor中构建应用程序的速度有了很好的了解。

翻译自: https://scotch.io/tutorials/learn-meteor-js-from-scratch-build-a-polling-app

构建meteor应用程序

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. Meteor.js

    CSDN首页 > 软件研发 优秀的Meteor学习资源 发表于2013-04-25 15:29| 4183次阅读| 来源CSDN| 0 条评论| 作者张红月编译 JavaScriptMeteor框架开源摘要&#xff1a;Meteor.js是建立在node.js上的一个开源平台&#xff0c;用于快速构建“现代化”实时Web应用。本文提供一些Ja…...

    2024/4/13 17:39:58
  2. 福州华美割福州华美做双眼皮好吗

    ...

    2024/4/13 17:39:43
  3. 程序员4月书讯:Angular来了!

    3月书讯中奖名单&#xff1a; 小棒棒《学习敏捷&#xff1a;构建高效团队》 镇屌的技术之路《学习敏捷:构建高效团队》 阿基米东《Scratch少儿趣味编程2》 民团司令《追踪引力波》 JOHNEW《算法图解》 中奖通知由CSDN官方发布站内消息&#xff0c;请关注消息通知~ 好书推荐…...

    2024/4/19 4:02:32
  4. Meteor:网络应用开发的瑞士军刀

    自从Node.js撼动整个Web开发领域以来&#xff0c;JavaScript Web全栈开发框架层出不穷&#xff0c;但是随着时间流逝&#xff0c;人们也逐渐意识到Node.js并不适合所有场景&#xff0c;一体化的开发框架也不一定适合JavaScript&#xff0c; 众多JS Web框架纷纷沉寂&#xff0c;…...

    2024/4/16 16:31:22
  5. 通过Windows进程ID获取窗口句柄(C++)

    方法一:使用EnumWindows的方式` ///< 枚举窗口参数 typedef struct{HWND hwndWindow; // 窗口句柄DWORD dwProcessID; // 进程ID}EnumWindowsArg; ///< 枚举窗口回调函数 BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam){EnumWindowsArg *pArg = (EnumWindows…...

    2024/4/18 21:58:05
  6. Meteor优秀学习资源-学习路线

    不久前&#xff0c;CSDN研发频道向大家介绍了一款新鲜出炉的现代网站开发平台——Meteor.js&#xff0c;Meteor.js是建立在node.js上的一个开源平台&#xff0c;用于快速构建“现代化”实时Web应用。如果你对Meteor.js非常感兴趣&#xff0c;可以参考Meteor Roadmap。 与此同时…...

    2024/4/19 13:08:50
  7. 福州去杭州双眼皮真格莱美

    ...

    2024/4/5 14:19:56
  8. 如何使用Meteor开发以太坊Dapp

    本教程将向你展示如何设置Meteor应用程序以用作app&#xff0c;并可能回答几个关于为什么应该使用Meteor的问题。 常问问题 Meteor不是一个完整的堆栈框架&#xff0c;它是如何适应app开发的 是的&#xff0c;Meteor是一个完整的堆栈框架&#xff0c;它的主要改进是实时Web应用…...

    2024/4/18 16:59:34
  9. 使用 Angular 2 开发单页应用程序之一

    由于具有实现更高性能的浏览器和智能电话应用程序的潜力&#xff0c;单页应用程序 (SPA) 技术在软件行业引起了广泛的兴趣。在过去 5 年多的时间里&#xff0c;开发人员对 Angular&#xff08;一个开源 SPA 框架&#xff09;的兴趣远超他们对其他 Web 框架&#xff08;React、B…...

    2024/4/13 17:40:08
  10. 益阳三点整容双眼皮哪里好多人

    ...

    2024/4/5 14:19:56
  11. 宿州双眼皮价格

    ...

    2024/4/15 11:35:15
  12. 割完双眼皮什么时候可以怀孕

    ...

    2024/4/5 14:19:51
  13. 双眼皮那里做得好多少钱

    ...

    2024/4/14 3:49:46
  14. angularjs input 搜索框触发请求太频繁,使用lodash.js的 debounce节流提高性能

    参考链接&#xff1a;https://ask.helplib.com/javascript/post_1177398 由于个人项目是使用angularjs1.3以上&#xff0c;则可以直接使用angularjs 自带的 ng-model-options"{ debounce: 1000 }"属性即可 <div ng-controller"Ctrl"><form name…...

    2024/4/13 17:40:28
  15. Angular6 获取当前浏览器地址

    今天刚好需要用到当前浏览器的url刚好记录一下,目前项目使用的是angular6,可以使用Location包也可以使用PlatformLocation&#xff0c;下面是两个对象打印出来的数据&#xff1a; Location: PlatformLocation: 从两个对象其实就可以看出BrowserPlatformLocation&#xff08;Pl…...

    2024/4/19 10:36:59
  16. 厦门双眼皮徐洋

    ...

    2024/4/13 17:40:43
  17. 埋双眼皮哪里医院好

    ...

    2024/4/13 17:40:48
  18. 肿眼泡能不能做牡丹江割双眼皮价格表

    ...

    2024/4/13 17:40:33
  19. 大连双眼皮艺星推举

    ...

    2024/4/18 7:39:00
  20. 去开张正文做双眼皮怎么样

    ...

    2024/4/13 17:40:53

最新文章

  1. FPGA_verilog语法整理

    FPGA_verilog语法整理 verilog的逻辑值 verilog的常数表达 位宽中指定常数的宽度&#xff08;表示成二进制数的位数&#xff09;&#xff0c;单引号加表示该常数为几进制的底数符号。 二进制底数符号为b&#xff0c;八进制为 o&#xff0c;十进制为d&#xff0c;十六进制为 h…...

    2024/4/20 6:59:35
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. PCF8591(ADDA转换芯片)

    工具 1.Proteus 8 仿真器 2.keil 5 编辑器 原理图 讲解 PCF8591是一个单片集成、单独供电、低功耗、8-bit CMOS数据获取器件。PCF8591具有4个模拟输入、1个模拟输出和1个串行IC总线接口。PCF8591的3个地址引脚A0, A1和A2可用于硬件地址编程&#xff0c;允许在同个I2C总线上接…...

    2024/4/18 19:27:25
  4. 【图论】知识点集合

    边的类型 neighbors(邻居)&#xff1a;两个顶点有一条共同边 loop&#xff1a;链接自身 link&#xff1a;两个顶点有一条边 parallel edges&#xff1a;两个顶点有两条及以上条边 无向图 必要条件&#xff1a;删掉顶点数一定大于等于剩下的顶点数 设无向图G<V,E>是…...

    2024/4/18 20:00:28
  5. HTML——3.链接、头部、图像

    一、链接 HTML 中的链接由 <a> 标签定义&#xff0c;用于创建可点击的文本或图像&#xff0c;以便导航到其他页面或资源。下面是一个简单的 HTML 链接示例&#xff1a; <a href"https://www.example.com">Visit Example</a> 在这个示例中&#…...

    2024/4/15 10:19:48
  6. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/4/19 14:24:02
  7. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/4/19 18:20:22
  8. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/4/19 11:57:31
  9. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/4/19 11:57:31
  10. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/4/19 11:57:52
  11. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/4/19 11:57:53
  12. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/4/19 11:58:14
  13. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/4/19 11:58:20
  14. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/4/19 23:45:49
  15. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/4/19 11:58:39
  16. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/4/19 11:58:51
  17. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/4/20 3:12:02
  18. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/4/19 11:59:15
  19. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/4/19 11:59:23
  20. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/4/19 11:59:44
  21. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/4/19 11:59:48
  22. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/4/19 12:00:06
  23. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/4/19 16:57:22
  24. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/4/19 12:00:25
  25. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/4/19 12:00:40
  26. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  27. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  28. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  29. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  30. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  31. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  32. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  33. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  34. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  35. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  36. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  37. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  38. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  39. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  40. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  41. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  42. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  43. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  44. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  45. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57